Skip to main content

Read and display a character from the keyboard

#include<stdio.h>
int main()
{
  char ch;
  printf("Enter a character\t:\t");
  scanf("%c", &ch );
  printf("The character you have entered is %c", ch);

  return 0;
}

Enter a character :  m
The character you have entered is m

Comments