Sie sind auf Seite 1von 2

Follow the case of the string.

Changes in each number are not carried to the next number.The value of the strings revert back to the original value for every number.
Determine the output of the program in the cout statement. Assume that the program is correct and running.

char s1[100]= "Champaca";


char s2[100]= "Rosal";
char s3[100]= “Sampaguita”;
char alp;
int x=3;

1. s1[4] = s2[0]; 11. x=0;


s1[3] = s3[5]; while(x<4)
cout<< s1; {
a. ChagRaca b. ChgRpaca c. Chgrpaca cout<<s1[x+1];
d. ChagRmpaca e. None of the above cout<<s3[x-1];
x=x+1;
}
a.CShaammp b. haammppa c.hwaSmapm d. None of the above
2. s2[3] = s3[6]; 12.
s2[4]= toupper(s3[3]); x=0;
cout<<s2; while(x<4)
a. RosUp b. RosuP c.RosUP d. Rosup e. None of the above {
s3[x+1]=s1[x+1];
cout<<s3[x];
x=x+1;
}
a. Shap b. Sham c. Samp d. None of the above
3. s3[3] = s2[2]; 13.
s3[4]= toupper(s3[2-1]); x=1;
strrev(s2); while(x<=4)
cout<<s3; {
a. lasoR b. atiugasmaS c. SamsAguita d.Lasor e. None of the above s1[x]=s3[x+1];
cout<<s1[x];
x=x+1;
}
a. mpag b. ampa c. hamp d. None of the above
4. x=2; 14. x=1;
s2[3] = s2[2]; while(x<=4)
s2[x+2]= toupper(s3[2-1]); {
strrev(s2); s1[x]=s3[x];
cout<<s2; s2[x-1] = s1[x];
a. AssoR b. lasoR c. atiugasmaS d. Alsor e. None of the above cout<<s1[x];
x=x+1;
}
a. mpag b. hamp c. ampa d. None of the above
5. 15. x=1;
x=strlen(s2); while(x<=6)
s1[x+2]= toupper(s3[x-1]); {
s1[x] = s2[x-1]; s1[x]=s3[x];
strrev(s1); s2[x-1] = s1[x];
cout<<s1; cout<<s1[x];
a. Aclpmahc b.aclpmahC c.lasoR d.AclpmahC x=x+2;
}
a. ampag b.apg c. hma d. none of the above
6. int y = 7; 16. x=3;
x=x*6; while(x<4)
y=x%4; {
s1[y]= toupper(s3[y+1]); s3[x+1]=s1[x];
s1[y+2] = s3[y-1]; cout<<s3;
cout<<s1; x=x+1;
a. Chaapmacab. Chapmaca. c.Chpmaaca d. Champmaca e. None of }
the above a. Sampmguita b. Sammaguita c. Samaaguita d. none of the Above
7. if (s1[2] == s2[3]) 17.
{ x=3;
s1[x]= s3[x+1]; while(x<4)
s1[x+2] = s3[x-1]; {
cout<<s1; s1[x]=s3[x-1];
} cout<<strrev(s3);
else x=x+1;
{ }
s2[x]= s3[x+1]; a. atiugampaS b. AtiugmapaS c.atuigmapaS d.atiugapmaS
s2[x+2] = s1[x-1];
cout<<s2;
}
a. Champaaca b. Chaapmca c. Champaca d.None of the
above
8. 18.
if (s1[2] == s2[3]) x=2;
{ while(x<4)
s3[x+2]= toupper(s1[x+1]); {
s3[x+1] = toupper(s1[x-1]); s1[x]=s3[x];
cout<<s3; x=x+1;
} }
else cout<<strrev(s1);
{
s3[x+1]= toupper(s3[x+1]); a. acapaphC b. acappmhC c. acappahC d. None of the Above
s3[x+2] = toupper(s1[x-1]);
cout<<s3;
}
a. SamPAguita b.SamPApuita c. SampAPuita
d.None of the above
9. while(x<5) 19. x=2;
{ while(x<4)
cout<<s1[x]; {
cout<<s2[x]; s1[x+1]=s3[x-1];
x=x+1; x=x+1;
} }
a. asma b. aaml c. mspa d.mapl cout<<strrev(s1);

a. acamaahC b. acapmahC c. acappmhC d. None of the above


10. while(x<6) 20. x=1;
{ while(x<4)
cout<<s1[x+1]; {
cout<<s3[x-1]; s3[x]=s1[x];
x=x+1; x=x+2;
} }
a. pmapca b. mmppaa c. mppaag d. none of the above cout<<strrev(s3);

a. atiuapmah b. atiugammhS c. atiugapmaS d. None of the Above

Das könnte Ihnen auch gefallen