File Input Output MCQs

296 questionsC-ProgramPage 10 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 82hard
What will be the output of the following C code?
#include <stdio.h>
#include <stdlib.h>
int main()
{
    FILE *fp = stdout;
    int n;
    fprintf(fp, "%d", 45);
}
Question 83medium
Which of the following is the correct declaration for ungetc?
Question 84easy
What is the purpose of sprintf?
Advertisement
Question 85hard
What will be the output of the following C code?
#include <stdio.h>
#include <math.h>
int main()
{
    int i = 10;
    printf("%f\n", log10(i));
    return 0;
}
Question 86medium
Memory allocation using malloc() is done in . . . . . . . .
Question 87medium
Which is true about isaplpha(c), where c is an int that can be represented as an unsigned?
char or EOF.isalpha(c) returns
Advertisement
Question 88medium
For the function call time(), what type of parameter is accepted?
Question 89easy
fwrite() can be used only with files that are opened in binary mode.
Question 90easy
What is meant by 'a' in the following C operation?
fp = fopen("Random.txt", "a");