putch() Library Function in C with Examples

The putch() function is used for printing character to a screen at current cursor location. It is unformatted character output functions. It is defined in header file conio.h.

putch() Syntax


putch() Examples

Example #1 : Displaying Character Using putch()


void main()
  char ch;
  clrscr(); /* Clear the screen */
  printf(“Press any character: ”);
  ch = getch();
  printf(“\nPressed character is:”);
  getch(); /* Holding output */

Output of the above program :

Press any character:
Pressed character is: e

Note: while using getch() pressed character is not echoed. 
Here pressed character is e and it is displayed by putch().