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.
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:
According to Tutorialspoint
Previous post: Hàm putc () in C
Next lesson: Ham puts () in C
4 ★ | 1 Vote