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


Question:
stderr is similar to?

1.stdin

2. stdout

3.both stdout and stdin

4.none of the mentioned


Question:
stderr is similar to?

1.stdin

2. stdout

3.Both stdout and stdin

4.None of the mentioned


Question:
stdout, stdin and stderr are ___

1.Structure

2.File pointers

3.File descriptors

4.Streams


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


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


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


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


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();


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();


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


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

1.abort(expr)

2.exit(expr)

3.ferror(expr)

4.none of the mentioned


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
  24. C MCQS:-The ABC of C
  25. C MCQS Interview Questions
  26. C++ Questions and Answers OOPs Basic Concepts
  27. C++ Questions and Answers Returning Objects
  28. C Programming MCQ Part 1
  29. C Programming MCQ
  30. Computer Science & Engineering C Multiple Choice Questions set 1
  31. Computer Science & Engineering C Multiple Choice Questions set 2
  32. C Multiple Choice Questions C Functions Set 1
  33. C Multiple Choice Questions C Functions Set 2
  34. C Multiple Choice Questions C Operators
  35. C Multiple Choice Questions & AnswersConditional Expressions
  36. C Multiple Choice Questions & Answers Data Types
  37. C Multiple Choice Questions & Answers File Access
  38. Computer Science & Engineering Cloud Computing MCQs Part 1
  39. CPP Programming MCQ Set 1
  40. CPP Programming MCQ Set 2
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!