Putchar () function in C

The function int putchar (int char) in standard C Library Writes a character (an unsigned char) defined by the char parameter to stdout.

The function int putchar (int char) in standard C Library Writes a character (an unsigned char) defined by the char parameter to stdout.

Declare putchar () function in C

Below is the declaration for putchar () function in C:

 int putchar ( int char ) 

Parameters

char - This is the character written.

Returns the value

This function returns the character read as an unsigned char that is cast to an int or EOF or an error.

For example

The following program C illustrates the usage of putchar () function in C:

 #include int main () { char ch ; for ( ch = 'A' ; ch <= 'Z' ; ch ++) { putchar ( ch ); } return ( 0 ); } 

Compiling and running the above C program will result:

Picture 1 of Putchar () function in C

According to Tutorialspoint

Previous post: Hàm putc () in C

Next lesson: Ham puts () in C

Update 25 May 2019
Category

System

Mac OS X

Hardware

Game

Tech info

Technology

Science

Life

Application

Electric

Program

Mobile