Output what you read from user - C Data Type

C examples for Data Type:char

Description

Output what you read from user

Demo Code

#include <stdio.h>
int main()//from  w w  w .j a v  a  2 s  . c o  m
{
   char num;
   printf("Enter a number from 0 to 9:");
   num = getchar();
   printf("You typed in %c!\n",num);
   return(0);
}

Result


Related Tutorials