C/C /C Programming - MCQ Questions Set 5 Sample Test,Sample questions

Question:
 Which of the following causes an error?

1. Trying to read a file that doesn’t exist

2.Inability to write data in a file

3.Failure to allocate memory with the help of malloc

4.All of the mentioned

Posted Date:-2021-02-20 21:46:37


Question:
stderr is similar to?

1.stdin

2. stdout

3.both stdout and stdin

4.none of the mentioned

Posted Date:-2021-02-20 21:46:37


Question:
stderr is similar to?

1.stdin

2. stdout

3.Both stdout and stdin

4.None of the mentioned

Posted Date:-2021-02-20 21:46:37


Question:
stdout, stdin and stderr are ___

1.Structure

2.File pointers

3.File descriptors

4.Streams

Posted Date:-2021-02-20 21:46:37


Question:
What is the purpose of the C function? int ferror(FILE *fp)

1. They check for input errors

2.They check for output errors

3.They check for all types of errors

4.They check for error in accessing the file

Posted Date:-2021-02-20 21:46:37


Question:
What is the purpose of the C function? int ferror(FILE *fp)

1.They check for input errors

2.They check for output errors

3. They check for all types of errors

4.They check for error in accessing the file

Posted Date:-2021-02-20 21:46:37


Question:
What will be the output of the following C statement?  fprintf(stderr, "error: could not open filen");

1.The diagnostic output is directly displayed in the output

2.The diagnostic output is pipelined to the output file

3.The line which caused error is compiled again

4. The program is immediately aborted

Posted Date:-2021-02-20 21:46:37


Question:
Which of the following causes an error?

1.Trying to read a file that doesn’t exist

2.Inability to write data in a file

3. Failure to allocate memory with the help of malloc

4.All of the mentioned

Posted Date:-2021-02-20 21:46:37


Question:
Which of the following function can be used to terminate the main function from another function safely?

1.return(expr);

2.exit(expr);

3.abort();

4.both exit(expr); and abort();

Posted Date:-2021-02-20 21:46:37


Question:
Which of the following function can be used to terminate the main() function from another function safely?

1.return(expr);

2.exit(expr);

3.abort();

4. both exit(expr); and abort();

Posted Date:-2021-02-20 21:46:37


Question:
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

Posted Date:-2021-02-20 21:46:37


Question:
Within main, return expr statement is equivalent to _______

1.abort(expr)

2.exit(expr)

3.ferror(expr)

4.none of the mentioned

Posted Date:-2021-02-20 21:46:37


More MCQS

  1. C++ Programming MCQS Set-1
  2. C++ Multiple Choice Questions Set-1
  3. C++ Multiple Choice Questions Set-2
  4. C++ Programming MCQS Set-2
  5. C++ Programming MCQS Set-3
  6. C++ Programming MCQS Set-4
  7. C++ (CPP) MCQ Question with Answer
  8. Advanced c++ multiple choice question(MCQS)
  9. OOPS Quiz Questions and Answers(MCQS)
  10. C Programming - MCQ Questions Set 1
  11. C Programming - MCQ Questions Set 2
  12. C Programming - MCQ Questions Set 3
  13. C Programming - MCQ Questions Set 4
  14. C Programming - MCQ Questions Set 5
  15. C++ programming language MCQ Questions Set 1
  16. C++ programming language MCQ Questions Set 2
  17. C++ programming language MCQ Questions Set 3
  18. C++ programming language MCQ Questions Set 4
  19. C++ programming language MCQ Questions Set 5
  20. C++ Programming -Constructors and Destructors
  21. C++ Programming -OOPS Concepts
  22. C++ Programming - References
  23. C++ Programming - Functions
Search
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!