C Programming :: Input / Output - Discussion
Home > C Programming > Input / Output > MCQs Questions Discussion
5 / 6
What would be the output of the following C program if input to the program is 'e'?
#include <stdio.h>
void main ()
{
char lower, upper;
lower = getchar();
upper= toupper (lower);
putchar (upper);
}
#include <stdio.h>
void main ()
{
char lower, upper;
lower = getchar();
upper= toupper (lower);
putchar (upper);
}
A53
Be
CE
DNothing
Answer: Option (Login/Signup)
Show Explanation
Asked In ::
STEP-BY-STEP
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.
Read Full Answer
Report Error
Please Login First Click Here