C++ MCQ Questions and Answers

Practice Mode
Showing 10 of 93 questions
Q91
Observe following function declaration and choose the best answer: int  divide ( int a, int b = 2 )
  • A Variable b is of integer type and will always have value 2
  • B Variable a and b are of int type and the initial value of both variables is 2
  • C Variable b is international scope and will have value 2
  • D Variable b will have value 2 if not specified when calling function
Answer: Option D
Q92
The keyword endl
  • A Ends the execution of program where it is written
  • B Ends the output in cout statement
  • C Ends the line in program. There can be no statements after endl
  • D Ends current line and starts a new line in cout statement.
Answer: Option D
Q93
Strings are character arrays. The last index of it contains the null-terminated character
  • A \n
  • B \t
  • C \0
  • D \1
Answer: Option C
Questions and Answers for Competitive Exams Various Entrance Test