Operators in C++

Last Updated :
Discuss
Comments

Question 1

Which of the following is a logical operator in C++?

  • &

  • &&

  • |

  • ++

Question 2

Which of these is a ternary operator in C++?

  • ++

  • --

  • ?:

  • ==

Question 3

What is the result of 5 % 2 in C++?

  • 2

  • 1

  • 0

  • 3

Question 4

Which operator is used for dereferencing a pointer?

  • &

  • *

  • ->

  • .

Question 5

Which of the following operators has the highest precedence?

  • +

  • =

  • ++

  • &&

Question 6

What is the output of true && false || true?

  • true

  • false

  • Error

  • Depends on the compiler

Question 7

What kind of operator is sizeof in C++?

  • Arithmetic

  • Bitwise

  • Unary

  • Logical

Question 8

Which operator cannot be overloaded in C++?

  • +

  • ==

  • : :

  • []

Question 9

What does the << operator do in C++ ?

  • Shift bits left

  • Output to stream

  • Both A and B

  • None of the above

Question 10

Which of the following is the correct syntax for using the ternary operator?

  • condition ? true : false;

  • condition : true ? false;

  • true ? false : condition;

  • condition ? : true false;

Tags:

There are 18 questions to complete.

Take a part in the ongoing discussion