1. get char () This function reads character type data from the standard input. It reads one character
at a time till the user presses the enter key.
4.14 Write a program to accept characters through keyboard using getchar I)function.
# include <stdio.h>
xnainO
{
charch [2 0];
int c«0;
clrscr ();
while ((ch[c] «getch ar()) lo '\n ')
C++;
ch[c] \0 • ;
p rin tf("\n%8"#ch);
}
OUTPUT;
COMPILER
COMPILER
ExplanationIn the
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.