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:
According to Tutorialspoint
Previous post: Hàm putc () in C
Next lesson: Ham puts () in C
Update 25 May 2019
You should read it
- The function gets () in C
- Function fputs () in C
- Function scanf () in C
- The getchar () function in C
- Function tmpfile () in C
- Function fscanf () in C
- The function sscanf () in C
- The function ungetc () in C
- The rewind () function in C
- The function perror () in C
- Function puts () in C
- The function atexit () in C
Maybe you are interested
Discovered mysterious signals emanating from a star right next to the Solar System, possibly of aliens NASA reveals its latest snapshot of the Martian surface with a resolution of 1.8 billion pixels Found the second planet of Proxima Centauri, the star closest to the sun 7 most modern astronaut ships on the planet Is Proxima b our 'neighbor' planet? Why have scientists found Proxima b - '2nd Earth' until now?