Write a Program For Use Of Putchar( ) And Getchar( ) Function

By

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);

ch = getchar();

 

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 : 

Write a Program For Use Of Putchar( ) And Getchar( ) Function

0 comments:

Post a Comment

Powered by Blogger.