C Programming :: Input / Output
5. What would be the output of the following C program if input to the program is 'e'?
void main ()
char lower, upper;
lower = getchar();
upper= toupper (lower);
As lower=getchar(), and the input is 'e', so lower will contain 'e'. In the next line 'e' will get converted to its upper case i.e, upper will contain 'E'. In the next line 'E' will get printed, so the correct option is option C.
15 Apr, 2019 12:02 AM
Please Login First Click Here