Character IO - Programming Tutorials

Programming Tutorials

Programming Tutorials

Ads Here

Character IO

getchar and putchar are used for the input or output only one character. getchar() It returns an int which is either EOF(indicating end-of-file) or the next character in the standard input stream. putchar(c) puts the character on the output stream. int main() { int a; a = getchar(); /* read and assign character to c */ putchar(a); /* print c on the screen */ return 0; }

No comments:

Post a Comment