0

Write the output of the follwing program segment.

Write the output of the follwing program segment char *NAME="CoMpuTeR"; for(int x=0;x<strlen(NAME);x++) if(islower(NAME[x])) NAME[x]=toupper(NAME[x]); else if(isupper(NAME[x])) if(x%2==0) NAME[x]=tolower(NAME[x])); else NAME[X]=NAME[x-1]; puts(NAME);

14th Nov 2017, 12:38 PM
Geoffrey N Agwata
Geoffrey N Agwata - avatar
2 Answers
+ 8
looks like the person has copied this into the question field instead of the description field
14th Nov 2017, 1:54 PM
jay
jay - avatar
+ 2
In general, the. output is nothing, as you simply haven't performed any cout operations. You may get an error, as the if isn't terminated by a null statement or braces. But since its a fragment, perhaps you forgot to copy the if's enclosure.
14th Nov 2017, 1:42 PM
Solo Wanderer 4315
Solo Wanderer 4315 - avatar