File Input Output MCQs

296 questionsC-ProgramPage 20 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 172medium
For floating point numbers, the precision flag specifies the number of decimal places to be printed. When no precision modifier is specified, printf() prints . . . . . . . .
Question 173easy
Which of the following is the correct syntax for calling function ungetc?
Assume int c and FILE *fp
Question 174easy
Which of the following cannot be used with ungetc()?
Advertisement
Question 175easy
Which character of pushback is guaranteed per file?
Question 176hard
If the user enters 1 s 3.2, what value will be returned by the scanf()?
scanf("%d %f %c", &a, &b, &c);
Question 177medium
String operation such as strcat(s, t), strcmp(s, t), strcpy(s, t) and strlen(s) heavily rely upon.
Advertisement
Question 178hard
What will be the output of the following C code?
#include <stdio.h>
int main()
{
    char str[10] = "hello";
    char *p = strrchr(str, 'l');
    printf("%c\n", *(++p));
}
Question 179medium
Which function will return the current file position for stream?
Question 180medium
When a C program is started, O.S environment is responsible for opening file and providing pointer for that file?