Solution :
#include<stdio.h>
#include<conio.h>
main()
{
char ch;
printf("Please Enter Your Character : ");
scanf("%c",&ch);
printf("%c",ch);
getch();
}
Program Analysis :
As we are working with character here, that's why we used character data type "char" and a character variable "ch"
This program is very simple and basic because the requirement is just to get input and print that same input so,
First we get input from terminal : scanf("%c",&ch);
Then we just print the value : printf("%c",ch);
We use %c for character type variable to get input and print output to the screen.
Post a Comment