AIM: Write a program for use of putchar( ) and getchar( ) function.
LOGIC:
C provides other ways to read and write single characters.
In particular, we can use the getchar() and putchar() functions instead of calling scanf and printf.
putchar() writes a single character:
putchar (ch);
getchar() has another advantage over Scanf :
Because it returns the character that it reads, getchar lends itself to various C idioms, including loops that search for a character or skip over all occurrence of character.
OUTPUT :

0 comments:
Post a Comment