File Input Output MCQs

296 questionsC-ProgramPage 7 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 55easy
Which pre-defined function returns a pointer to the last occurence of a character in a string?
Question 56medium
Select the correct value of i from given options i=scanf("%d %d", &a, &b);
Question 57medium
What error will generate if the read and write parameters are not separated by commas?
Advertisement
Question 58medium
gets() and puts() operate on . . . . . . . .
Question 59hard
What will be the output of the following C code?
#include <stdio.h>
int main()
{
    char str[11] = "hello";
    char *str1 = "world";
    strcat(str, str1);
    printf("%s %d", str, str[10]);
}
Question 60medium
Only . . . . . . . . character of pushback is guaranteed per file when ungetc is used.
Advertisement
Question 61easy
Which of the following statements about stdout and stderr are true?
Question 62easy
What is the meaning of the following C statement?
printf(“%10s”, state);
Question 63hard
What will be the output of the following C code?
#include <stdio.h>
int main()
{
    short int i;
    scanf("%*d", &i);
    printf("%hd", i);
    return 0;
}