Please answer the question in C program only please Write a
Please answer the question in C program only please.
Write a C program using the getchar (), toupper (), and putchar () functions that echo back all letters entered in their uppercase form. The program should terminate when either an x or X is entered.Solution
#include<stdio.h>
int main()
{
char ch;
//Accepts a character and converts it into upper case
ch = toupper(getchar());
//Accepts the character till Uppercase or lowercase x is entered
while(ch != \'X\')
{
//Displays the inputed character in uppercase
putchar(toupper(ch));
ch = toupper(getchar());
}
}
Outpu
t
T
y
Y
s
S
o
O
p
P
m
M
x
