InterviewSolution
Saved Bookmarks
| 1. |
Find the output of the following program:#include<iostream.h>#include<ctype.h>void MyCode(char Msg[],char CH){for(int Cnt=0;Msg[cnt]!='\0';Cnt++){if(Msg[Cnt]>='B' && Msg[Cnt]<='G')Msg[Cnt]=tolower(Msg[Cnt]);elseif(Msg[Cnt]>='A' && Msg[Cnt]<='a')Msg[Cnt]=CH;elseif(Cnt%2==0)Msg[Cnt]=toupper(Msg[Cnt]);elseMsg[Cnt]=Msg[Cnt-1];}}void main() {char MyText[]="ApEACeDriVE";MyCode(MyText,'@');cout<<"NEW TEXT:"<<MyText<<end1; |
|
Answer» Output: NEW TEXT:[email protected]@e |
|