working of this code ,also explain about it explaination nd How it print WELCOME ...

Status
Not open for further replies.

arpk

Reputable
May 31, 2014
1
0
4,510
#include<string.h>
void main()
{
char*msg="WELCOME";
for(int i=strlen(msg)-1;i>=0;i--)
if(islower(msg))
{
msg=toupper(msg);
cout<<msg;
}
else
if(isupper(msg))
if(i%2!=0)
msg=tolower(msg[i-1]);
else
msg[i--];
cout<<msg<<endl;
getch();
}
 
Status
Not open for further replies.