File Input Output MCQs

296 questionsC-ProgramPage 13 of 33

Practice free File Input Output multiple-choice questions with instant answer feedback and step-by-step solutions. Click an option to check yourself, reveal the full explanation, and work through all 296 questions — no login required.

Question 109hard
What will be the output of the following C code?
#include <stdio.h>
#include <stdarg.h>
int f(char c, ...);
int main()
{
    char c = 97, d = 98;
    f(c, d);
    return 0;
}
int f(char c, ...)
{
    va_list li;
    va_start(li, c);
    char d = va_arg(li, int);
    printf("%c\n", d);
    va_end(li);
}
Question 110medium
What will be the output of the following C statement?
int sscanf(char *string, char *format, arg1, arg2, ...)
Question 111easy
The syntax of fgets is char *fgets(char *line, int maxline, FILE *fp). Which is true for fgets?
Advertisement
Question 112medium
What does the following C code snippet mean?
char *gets(char *s)
Question 113easy
Which functions is declared in ?
Question 114easy
What does scanf() function return?
Advertisement
Question 115medium
What will be the output of the following C code?
#include <stdio.h>
int main()
{
    FILE *fp = stdout;
    stderr = fp;
    fprintf(stderr, "%s", "hello");
}
Question 116easy
What is the use of symbol * in the control string as shown [=%[*][width] [modifiers] type=]?
Question 117medium
Which of the following function can be used to terminate the main function from another function safely?