C++ MCQs with answers Page - 134

Here, you will find a collection of MCQ questions on C++. Go through these questions to enhance your preparation for upcoming examinations and interviews.

To check the correct answer, simply click the View Answer button provided for each question.

Have your own questions to contribute? Click the button below to share your MCQs with others!

+ Add Question

A

Admin • 833.24K Points
Coach

Q. The visibility of variables inside a structure is

  • (A) Private
  • (B) Public
  • (C) Protected
  • (D) None of these

A

Admin • 833.24K Points
Coach

Q. ‐‐‐‐‐‐‐ are used for comparing two conditions or to write a compound condition.

  • (A) Relational operators
  • (B) Ternary operator
  • (C) Conditional operator
  • (D) Logical operator

A

Admin • 833.24K Points
Coach

Q. ‐‐‐‐‐ statement is used to print a blank line in CPP program

  • (A) “ ”
  • (B) endl
  • (C) Both ‘a’ and ‘b’
  • (D) None of these

A

Admin • 833.24K Points
Coach

Q. int d=int (a) + int (b);This statement is an example of ‐‐‐‐‐‐‐

  • (A) Implicit conversion
  • (B) Explicit conversion
  • (C) Internal conversion
  • (D) External conversion

A

Admin • 833.24K Points
Coach

Q. Within a switch statement

  • (A) Continue can be used but Break cannot be used
  • (B) Continue cannot be used but Break can be used
  • (C) Both Continue and Break can be used
  • (D) Neither Continue nor Break can be used

A

Admin • 833.24K Points
Coach

Q. Strings are character arrays. The last index of it contains the null‐terminated character

  • (A)
  • (B)
  • (C)
  • (D) 1

A

Admin • 833.24K Points
Coach

Q. Observe following function declaration and choose the best Ans:: 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

A

Admin • 833.24K Points
Coach

Q. Arguments of a functions are separated with

  • (A) comma (,)
  • (B) semicolon (;)
  • (C) colon (:)
  • (D) None of these

A

Admin • 833.24K Points
Coach

Q. Variables inside parenthesis of functions declarations have _____ level access.

  • (A) Local
  • (B) Global
  • (C) Module
  • (D) Universal

A

Admin • 833.24K Points
Coach

Q. ‐‐‐‐‐‐‐‐‐‐‐ Statement used to branch unconditionally from one point to another in the program.

  • (A) Jump
  • (B) goto
  • (C) break
  • (D) exit(0)

Add MCQ in this Category

If you want to share an MCQ question in this category, it's a great idea! It will be helpful for many other students using this website.

Share Your MCQ