C++ MCQs with answers Page - 56

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. What are the actual parameters in C++?

  • (A) Parameters with which functions are called
  • (B) Parameters which are used in the definition of a function
  • (C) Variables other than passed parameters in a function
  • (D) Variables that are never used in the function

A

Admin • 833.24K Points
Coach

Q. What are the formal parameters in C++?

  • (A) Parameters which are used in the definition of the function
  • (B) Parameters with which functions are called
  • (C) Variables that are never used in the function
  • (D) Variables other than passed parameters in a function

A

Admin • 833.24K Points
Coach

Q. Which function is used to read a single character from the console in C++?

  • (A) getline(ch)
  • (B) cin.get(ch)
  • (C) scanf(ch)
  • (D) read(ch)

A

Admin • 833.24K Points
Coach

Q. Who created C++?

  • (A) Dennis Ritchie
  • (B) Bjarne Stroustrup
  • (C) Brian Kernighan
  • (D) Ken Thompson

A

Admin • 833.24K Points
Coach

Q. Which of the following escape sequence represents tab?

  • (A)
  • (B) 
  • (C)
  • (D) a

A

Admin • 833.24K Points
Coach

Q. Which of the following escape sequence represents carriage return?

  • (A)
  • (B)
  • (C)
  • (D) c

A

Admin • 833.24K Points
Coach

Q. What are the escape sequences?

  • (A) Set of characters that convey special meaning in a program
  • (B) Set of characters that are used in the name of the main function of the program
  • (C) Set of characters that whose use are avoided in C++ programs
  • (D) Set of characters that are avoided in cout statements

A

Admin • 833.24K Points
Coach

Q. Which function is used to write a single character to console in C++?

  • (A) cout.put(ch)
  • (B) cout.putline(ch)
  • (C) write(ch)
  • (D) printf(ch)

A

Admin • 833.24K Points
Coach

Q. The address of a variable temp of type float is

  • (A) float temp&
  • (B) float& temp
  • (C) &temp
  • (D) *temp

A

Admin • 833.24K Points
Coach

Q. What is the output of the following code?

Code:
char symbol[3]={‘a’,‘b’,‘c’}; for (int index=0; index<3; index++) cout << symbol [index];
  • (A) ‘abc’
  • (B) abc
  • (C) “abc”
  • (D) a b c