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 127hard
What will be the output of the following C code?
#include <stdio.h>
void main()
{
char *p = calloc(100, 1);
p = "welcome";
printf("%s\n", p);
}Question 128easy
Explain the format string "%5d%s %c"
Question 129easy
What is the difference between %e and %g?
Advertisement
Question 130easy
Strcat() function adds null character.
Question 131easy
What is the size of array "line" used in fgets(line, maxline, *fp) function?
Question 132medium
What will be the output of the following C statement?
int ungetc(int c, FILE *fp)Advertisement
Question 133hard
In the below C program, every time program is run different numbers are generated.
#include <stdio.h>
#include <stdlib.h>
int main()
{
printf("%d\n", rand());
return 0;
}Question 134medium
What does the ungetc function return for the following C expression?
ungetc(c, fp);//where declarations are int c and FILE *fpQuestion 135hard
If the user enters 1 3.2 s, what value will be returned by the scanf()?
scanf("%d %f %c", &s1, &s2, &s3);