VOOZH about

URL: https://www.geeksforgeeks.org/c/putchar-function-in-c/

⇱ putchar() function in C - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

putchar() function in C

Last Updated : 6 Oct, 2023

The putchar(int ch) method in C is used to write a character, of unsigned char type, to stdout. This character is passed as the parameter to this method.

Syntax:

int putchar(int ch)

Parameters: This method accepts a mandatory parameter ch which is the character to be written to stdout.

Return Value: This function returns the character written on the stdout as an unsigned char. It also returns EOF when some error occurs. 

The below examples illustrate the use of putchar() method:

Example 1:


Output
G

Example 2:


Output
123456789
Comment
Article Tags: