File Input Output MCQs

296 questionsC-ProgramPage 14 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 118medium
For a typical program, the input is taken using . . . . . . . .
Question 119easy
What is the return value of putchar()?
Question 120hard
What will be the output of the following C code?
#include <stdio.h>
int f(char chr, ...);
int main()
{
    char c = 97;
    f(c);
    return 0;
}
int f(char c, ...)
{
    printf("%c\n", c);
}
Advertisement
Question 121hard
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;
}
Question 122medium
What will be the output of the following C code?
char str[] =”Good”;
scanf(“%s”, str);
Question 123medium
What type of return-type used in String operations?
Advertisement
Question 124medium
The function . . . . . . . . obtains a block of memory dynamically.
Question 125easy
What happens when we use the following C statement?
Question 126hard
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;
}