normal 0 false false false en-in x-none


Compare putchar function with the getchar function.

The following program uses getchar to copy the first word from a line of input entered at the terminal's keyboard. Then, it displays the word on the terminal's screen.

 #include

int c;

main()

{

puts("Enter some words on a line.");

/* Look for white space */

while ((c != ' ') && (c != '\t') && (c != '\n'))

{

c = getchar();

putchar(c);

}

putchar('\n');

}

 

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: normal 0 false false false en-in x-none
Reference No:- TGS0305461

Expected delivery within 24 Hours