1.

What will be the output of the program?_x000D_ #include_x000D_ _x000D_ int main()_x000D_ {_x000D_ int i;_x000D_ char c;_x000D_ for(i=1; i<=5; i++)_x000D_ {_x000D_ scanf("%c", &c); /* given input is 'a' */_x000D_ printf("%c", c);_x000D_ ungetc(c, stdin);_x000D_ }_x000D_ return 0;_x000D_ }

A. aaaa
B. aaaaa
C. Garbage value.
D. Error in ungetc statement.
Answer» C. Garbage value.


Discussion

No Comment Found