Sail E0 Webinar

MCQs

Total Questions : 13 | Page 1 of 2 pages
Question 1. FILE reserved word is?
  1.    A structure tag declared in stdio.h
  2.    One of the basic datatypes in c
  3.    Pointer to the structure defined in stdio.h
  4.    It is a type name defined in stdio.h
 Discuss Question
Answer: Option D. -> It is a type name defined in stdio.h


None.


Question 2. stdout, stdin and stderr are?
  1.    File pointer
  2.    File desciptors
  3.    Streams
  4.    Structure
 Discuss Question
Answer: Option A. -> File pointer


None.


Question 3. Which of the following statements about stdout and stderr are true?
  1.    Same
  2.    Both connected to screen always.
  3.    Both connected to screen by default.
  4.    stdout is line buffered but stderr is unbuffered.
 Discuss Question
Answer: Option C. -> Both connected to screen by default.


None.


Question 4. If there is any error while opening a file, fopen will return?
  1.    Nothing
  2.    EOF
  3.    NULL
  4.    Depends on compiler
 Discuss Question
Answer: Option C. -> NULL


None.


Question 5. For binary files, a ___ must be appended to the mode string.
  1.    Nothing
  2.    b"
  3.    binary"
  4.    01?
 Discuss Question
Answer: Option A. -> Nothing


None.


Question 6. The first and second arguments of fopen are?
  1.    A character string containing the name of the file & the second argument is the mode.
  2.    A character string containing the name of the user & the second argument is the mode.
  3.    A character string containing file poniter & the second argument is the mode.
  4.    None of the mentioned of the mentioned.
 Discuss Question
Answer: Option A. -> A character string containing the name of the file & the second argument is the mode.


None.


Question 7. When a C program is started, O.S environment is responsible for opening file and providing pointer for that file?
  1.    Standard input
  2.    Standard output
  3.    Standard error
  4.    All of the mentioned
 Discuss Question
Answer: Option D. -> All of the mentioned


None.


Question 8. Which is true about getc.getc returns?
  1.    The next character from the stream referred to by file pointer
  2.    EOF for end of file or error
  3.    Both a & b
  4.    Nothing
 Discuss Question
Answer: Option C. -> Both a & b


None.


Question 9. What is the meant by 'a' in the following operation?
fp = fopen("Random.txt, "a);
  1.    Attach
  2.    Append
  3.    Apprehend
  4.    Add
 Discuss Question
Answer: Option B. -> Append


None.


Question 10. What does the following segment of code do?
fprintf(fp, "Copying!);
  1.    It writes Copying!" into the file pointed by fp
  2.    It reads Copying!" from the file and prints on display
  3.    It writes as well as reads Copying!" to and from the file and prints it
  4.    None of the mentioned
 Discuss Question
Answer: Option D. -> None of the mentioned


None.


Latest Videos

Latest Test Papers