21.
What will be the output of the following C code?
#include <stdio.h>
#include <string.h>
int main()
{
    char line[3];
    fgets(line, 3, stdin);
    printf("%d\n", strlen(line));
    return 0;
}

25.
What happens when we use the following C statement?

26.
What will be the output of the following C code?
#include <stdio.h>
int main()
{
    FILE *fp = stdout;
    int n;
    fprintf(fp, "%d ", 45);
    fflush(stdout);
    fprintf(stderr, "%d", 65);
    return 0;
}

28.
Explain the format string "%5d%s %c"

29.
What is the difference between %e and %g?

Read More Section(File Input Output)

Each Section contains maximum 100 MCQs question on File Input Output. To get more questions visit other sections.