-->

about getchar() and putchar()

 getchar():-

It is an input function used to input one character. It does not accept more than one character. If we input more than one then it truncates remaing charcaters.

Syntax:-

variable=getchar();

Example:

char a;

printf("enter a character\n");

a=getchar();

printf("character=%c",a);

putchar():

It is an outputput function used to output one character.It works like printf(). It does not display  more than one character. If we input more than one then it truncates remaing charcaters an dprints the first character.

Syntax:-

putchar(variable);

Example:

char a;

printf("enter a character\n");

a=getchar();

putchar(a);