File Input Output MCQs

296 questionsC-ProgramPage 31 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 271hard
What will be the output of the following C code?
#include <stdio.h>
int main()
{
    short int i;
    scanf("%hd", &i);
    printf("%hd", i);
    return 0;
}
Question 272easy
fflush(NULL) flushes all . . . . . . . .
Question 273hard
What will be the output of the following C code?
#include <stdio.h>
int main()
{
    FILE *fp = stdout;
    int n;
    fprintf(fp, "%d\n ", 45);
    fprintf(stderr, "%d ", 65);
    return 0;
}
Advertisement
Question 274easy
What will fopen will return, if there is any error while opening a file?
Question 275medium
Which of the following is the right declaration for fgets() inside the library?
Question 276hard
What will be the output of the following C code?
#include <stdio.h>
int main()
{
    int i = 10, j = 3;
    printf("%d %d %d", i, j);
}
Advertisement
Question 277medium
What will be the output of the following C code?
#include <stdio.h>
int main()
{
    char *n;
    scanf("%s", n);
    return 0;
}
Question 278medium
Which of the following fopen() statements are illegal?
Question 279easy
The syntax of printf() function is printf("control string", variable list) ;what is the prototype of the control string?