Warning: implode(): Invalid arguments passed in /www/wwwroot/jobquiz.info/mdiscuss.php on line 336 What will be the output of the program? #include<stdio.h> int main() { int i; char c; for(i=1; i<=5; i++) { scanf("%c", &c); / given input is 'b' / ungetc(c, stdout); printf("%c", c); ungetc(c, stdin); } return 0; } ?->(Show Answer!)
1. What will be the output of the program? #include<stdio.h> int main() { int i; char c; for(i=1; i<=5; i++) { scanf("%c", &c); / given input is 'b' / ungetc(c, stdout); printf("%c", c); ungetc(c, stdin); } return 0; }
Ask Your Doubts Here
Comments
By: guest on 01 Jun 2017 06.02 pm
The ungetc() function pushes the character c back onto the named input stream, which must be open for reading. This character will be returned on the next call to getc or fread for that stream. One character can be pushed back in all situations. A second call to ungetc without a call to getc will force the previous character to be forgotten.