/* */ Click to Join Live Class with Shankar sir Call 9798158723

C Input/Output file MCQ


Q1. Which among the following is the odd one out?
  1. printf
  2. fprintf
  3. putchar
  4. scanf

Answer:- (D).
Explanations :none.
Q2. For a typical program, the input is taken using _________
  1. scanf
  2. Files
  3. Command-line
  4. All of the mentioned

Answer:- (D).
Explanations :none.
Q3. What does the following command line signify?
  1. It runs prog1 first, prog2 second
  2. It runs prog2 first, prog1 second
  3. It runs both the programs, pipes output of prog1 to input of prog2
  4. It runs both the programs, pipes output of prog2 to input of prog1

Answer:- (C).
Explanations :none
Q4.What is the default return-type of getchar()?
  1. char
  2. int
  3. char *
  4. reading character doesn’t require a return-type

Answer:- (B).
Explanations :none
Q5. What is the value of EOF?
  1. -1
  2. 0
  3. 1
  4. 10

Answer:- (A).
Explanations :none
Q6. What is the use of getchar()?
  1. The next input character each time it is called
  2. EOF when it encounters end of file
  3. The next input character each time it is called EOF when it encounters end of file
  4. None of the mentioned

Answer:- (C).
Explanations :none
Q7. Which of the following statement is true?
  1. The symbolic constant EOF is defined in
  2. The value is -1
  3. The symbolic constant EOF is defined in & value is -1
  4. I Only value is -1

Answer:- (C).
Explanations :none
Q8. What is the return value of putchar()?
  1. The character written
  2. EOF if an error occurs
  3. Nothing
  4. Both character written & EOF if an error occurs

Answer:- (D).
Explanations :none
Q9. Which is true about function tolower?
  1. The function tolower is defined in
  2. Converts an uppercase letter to lowercase
  3. Returns other characters untouched
  4. None of the mentioned

Answer:- (D).
Explanations :none
Q10. What will be the output of the following C code?
#include 
    int main()
    {
        char c = '�';
        putchar(c);
    }
  1. Compile time error>
  2. Nothing
  3. 0
  4. Undefined behaviour

Answer:- (B).
Explanations :none