Sail E0 Webinar

MCQs

Total Questions : 9
Question 1. Which among the following is odd one out?
  1.    printf
  2.    fprintf
  3.    putchar
  4.    scanf
 Discuss Question
Answer: Option D. -> scanf


None.


Question 2. For a typical program, the input is taken using.
  1.    scanf
  2.    Files
  3.    Command-line
  4.    None of the mentioned.
 Discuss Question
Answer: Option D. -> None of the mentioned.


None.


Question 3. What does the following command line signify?      
prog1|prog2
  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
 Discuss Question
Answer: Option C. -> It runs both the programs, pipes output of prog1 to input of prog2


None.


Question 4. What is the default return-type of getchar()?
  1.    char
  2.    int
  3.    char *
  4.    Reading character doesn't require a return-type
 Discuss Question
Answer: Option B. -> int


None.


Question 5. The value of EOF is_____.
  1.    -1
  2.    0
  3.    1
  4.    10
 Discuss Question
Answer: Option A. -> -1


None


Question 6. 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.    Both a & b
  4.    None of the mentioned
 Discuss Question
Answer: Option C. -> Both a & b


None.


Question 7. Which is true?
  1.    The symbolic constant EOF is defined in
  2.    The value is typically -1,
  3.    Both a & b
  4.    Either a or b
 Discuss Question
Answer: Option C. -> Both a & b


None.


Question 8. putchar(c) function/macro always outputs character c to the:
  1.    screen
  2.    standard output
  3.    depends on the compiler
  4.    depends on the standard
 Discuss Question
Answer: Option B. -> standard output


None.


Question 9. What is the use of putchar()?
  1.    The character written
  2.    EOF is an error occurs
  3.    Nothing
  4.    Both a & b
 Discuss Question
Answer: Option D. -> Both a & b


None.


Latest Videos

Latest Test Papers