C++ MCQs with answers Page - 141

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. Identify the valid integer from the following:

  • (A) 325.6
  • (B) 255 356UL
  • (C) ‐3658 9586L
  • (D) +324454ul

A

Admin • 833.24K Points
Coach

Q. A ‐‐‐‐‐ is the name of the storage location

  • (A) Identifier
  • (B) Variable
  • (C) Keyword
  • (D) Token

A

Admin • 833.24K Points
Coach

Q. The operator “>>” is called ‐‐‐‐‐

  • (A) Extraction operator
  • (B) Insertion operator
  • (C) Put to operator
  • (D) Printing operator

A

Admin • 833.24K Points
Coach

Q. Array indexing always starts with the number

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

A

Admin • 833.24K Points
Coach

Q. We declare a function with ______ if it does not have any return type

  • (A) long
  • (B) double
  • (C) void
  • (D) int

A

Admin • 833.24K Points
Coach

Q. Which of the following is selection statement in C++?

  • (A) Break
  • (B) goto
  • (C) exit
  • (D) switch

A

Admin • 833.24K Points
Coach

Q. There is a unique function in C++ program by where all C++ programs start their execution

  • (A) start()
  • (B) begin()
  • (C) main()
  • (D) output()

A

Admin • 833.24K Points
Coach

Q. A block comment can be written by

  • (A) Starting every line with double slashes (//)
  • (B) Starting with /* and ending with */
  • (C) Starting with //* and ending with *//
  • (D) Starting with <!‐ and ending with ‐!>

A

Admin • 833.24K Points
Coach

Q. Which of the following is a correct comment?

  • (A) */ Comments */
  • (B) ** Comment **
  • (C) /* Comment */
  • (D) { Comment }

A

Admin • 833.24K Points
Coach

Q. Which of the following is the correct syntax for defining a constant in C++?

  • (A) const int x = 5;
  • (B) constant int x = 5;
  • (C) int const x = 5;
  • (D) int x = const 5;