Play(G,15); void main() { } char Message[ ]="ArabSagar"; Secret(Message); cout<<Message<<endl; } (3) In the following program, if the value of Guess (4) void swap(char &c1,char &c2) entered by the user is 65, what { char temp; will be the expected output(s) from the following temp=c1; c1=c2; c2=temp; options (i), (ii), (iii) and (iv)? } #include <iostream.h> void update(char *str) #include <stdlib.h> { int k,j,l1,l2; void main() l1 = (strlen(str)+1)/2; { int Guess; l2=strlen(str); randomize(); for(k=0,j=l1-1;k<j;k++,j–) cin>>Guess; { if(islower(str[k])) for (int I=1;I<=4;I++) swap(str[k],str[j]); { } New=Guess+random(I); for(k=l1,j=l2-1;k<j;k++,j–) cout<<(char)New; { if(isupper(str[k])) } swap(str[k],str[j]); } } } (i) ABBC void main() (ii) ACBA { chardata[100]={“gOoDLUck”}; (iii) BCDA cout<<”OriginalData“<<data<<endl; (iv) update(data); cout<<”UpdatedData“<<data; }
Play(G,15); } void main() { char Message[ ]="ArabSagar"; Secret(Message); cout<<Message<<endl; } (3) In the following program, if the value of Guess entered by the user is 65, what will be the expected output(s) from the following options (i), (ii), (iii) and (iv)? #include <iostream.h> #include <stdlib.h> void main() { int Guess; (4) void swap(char &c1,char &c2) { char temp; temp=c1; c1=c2; c2=temp; } void update(char *str) { int k,j,l1,l2; l1 = (strlen(str)+1)/2; l2=strlen(str); randomize(); cin>>Guess; for (int I=1;I<=4;I++) { New=Guess+random(I); cout<<(char)New; } } (i) ABBC (ii) ACBA (iii) BCDA (iv) for(k=0,j=l1-1;k<j;k++,j–) { if(islower(str[k])) swap(str[k],str[j]); } for(k=l1,j=l2-1;k<j;k++,j–) { if(isupper(str[k])) swap(str[k],str[j]); } } void main() { chardata[100]={“gOoDLUck”}; cout<<”OriginalData“<<data<<endl; update(data); cout<<”UpdatedData“<<data; }
1736284099class_1-10_&_12_holiday_homework.docx