Home / CSE MCQs / C-MCQs :: Standard Input and Output

CSE MCQs :: C-MCQs

  1. Which among the following is odd one out?
  2. A.
    printf
    B.
    fprintf
    C.
    putchar
    D.
    scanf

  3. For a typical program, the input is taken using.
  4. A.
    scanf
    B.
    Files
    C.
    Command-line
    D.
    None of the mentioned.

  5. What does the following command line signify?
           prog1|prog2
  6. A.
    It runs prog1 first, prog2 second
    B.
    It runs prog2 first, prog1 second
    C.
    It runs both the programs, pipes output of prog1 to input of prog2
    D.
    It runs both the programs, pipes output of prog2 to input of prog1

  7. What is the default return-type of getchar()?
  8. A.
    char
    B.
    int
    C.
    char *
    D.
    Reading character doesn't require a return-type

  9. What is the use of getchar()?
  10. A.
    The next input character each time it is called
    B.
    EOF when it encounters end of file.
    C.
    Both a & b
    D.
    None of the mentioned

  11. Which is true?
  12. A.
    The symbolic constant EOF is defined in
    B.
    The value is typically -1,
    C.
    Both a & b
    D.
    Either a or b

  13. What is the use of putchar()?
  14. A.
    The character written
    B.
    EOF is an error occurs
    C.
    Nothing
    D.
    Both a & b

  15. putchar(c) function/macro always outputs character c to the:
  16. A.
    screen
    B.
    standard output
    C.
    depends on the compiler
    D.
    depends on the standard