File Input Output MCQs

296 questionsC-ProgramPage 27 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 235medium
Select the right explanation for the following C code snippet.
int fgetpos(FILE *stream, fpos_t *s)
Question 236hard
What will be the output of the following C code if 2 characters is typed by the user?
#include <stdio.h>
#include <string.h>
int main()
{
    char line[3];
    fgets(line, 3, stdin);
    printf("%d\n", line[2]);
    return 0;
}
Question 237medium
What will be the output of the following C code?
char str[] =”Too Good”;
printf(“\n %7s”,str);
Advertisement
Question 238hard
What will be the output of the following C code?
#include <stdio.h>
#include <math.h>
void main()
{
    int k = pow(2, 3);
    printf("%d\n", k);
}
Question 239easy
Which of the following library function is not case-sensitive?
Question 240hard
What will be the output of the following C code?
#include <stdio.h>
int main()
{
    char *s = "myworld";
    int i = 9;
    printf("%*s", i, s);
}
Advertisement
Question 241easy
What is the prototype of scanf function?
Question 242hard
What will be the output of the following C code?
#include <stdio.h>
#include <math.h>
int main()
{
    int i = 90;
    printf("%f\n", sin(i));
    return 0;
}
Question 243easy
Which type of files can't be opened using fopen()?