File Input Output MCQs
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 136medium
Why do we write (int *) before malloc?
int *ip = (int *)malloc(sizeof(int));Question 137easy
What type of inputs are accepted by mathematical functions?
Question 138hard
What will be the output of the following C code?
#include <stdio.h>
int main()
{
FILE *fp;
char c;
int n = 0;
fp = fopen("newfile1.txt", "r");
while (!feof(fp))
{
c = getc(fp);
putc(c, stdout);
}
}Advertisement
Question 139hard
What will be the output for the given code.
printf("\n The number is %07d",1212);Question 140medium
Which of the following will return a result most quickly for searching a given key?
Question 141medium
Which of the following macro extracts an argument from the variable argument list (ie ellipsis) and advance the pointer to the next argument?
Advertisement
Question 142medium
calloc() initialize memory with all bits set to zero.
Question 143medium
Which of the following snippet will effectively generate random numbers?
Question 144medium
The statement prog < infile causes . . . . . . . .