File Input Output MCQs

296 questionsC-ProgramPage 5 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 37hard
What will be the output of the following C code?
#include <stdio.h>
struct p
{
   struct p *next;
   int x;
};
int main()
{
   struct p* p1 = malloc(sizeof(struct p));
   p1->x = 1;
   p1->next = malloc(sizeof(struct p));
   printf("%d\n", p1->next->x);
   return 0;
}
Question 38medium
If the conversion characters of int d, i, o, u and x are preceded by h, it indicates?
Question 39medium
Which among the following mathematical function do not have a "double" return-type?
Advertisement
Question 40medium
Which of the following function compares 2 strings with case-insensitively?
Question 41easy
What is FILE reserved word?
Question 42hard
What will be the output of the following C code?
#include <stdio.h>
#include <math.h>
int main()
{
    unsigned int i = -1;
    printf("%f\n", fabs(i));
    return 0;
}
Advertisement
Question 43easy
Each call of va_arg . . . . . . . .
Question 44medium
setvbuf() and setbuf() function controls buffering for the stream.
Question 45hard
What will be the output of the following C code if following commands are used to run (considering myfile exists)?
gcc -otest test.c
./test < myfile

#include <stdio.h>
int main()
{
    char c = 'd';
    putchar(c);
}