Vidyalelo
C Programming · Q75

File Input Output

Programming · C Programming · question 75

Q75

What will be the output of the following C code considering user typed jkl? #include int main() char n[20]; fgets(n, 19, stdin); ungetc(n[0], stdin); printf("%s ", n); return 0;

A.
jkl
Answer
B.
kl
C.
Undefined behaviour
D.
jk

Answer: Option A

Solution

Answer: Option A
No explanation is given for this question Let's Discuss on Board