Learn with Yasir

Share Your Feedback

C++ Review Questions


Review C++ operators and conditional statements with questions on arithmetic, assignment, relational, and logical operators, if-else logic, and nested conditions.

1. Basics

Operators: Basics

Answer the following questions.

  1. What is an operator?
  2. What is an operand?
  3. What is an expression?
  4. What is a unary operator?
  5. What is a binary operator?
  6. What is the purpose of +?
  7. What is the purpose of %?
  8. What is the difference between = and ==?
  9. What is the difference between ++x and x++?
  10. What is the purpose of --?
  11. What does >= mean?
  12. What does != mean?
  13. What is the purpose of &&?
  14. What is the purpose of ||?
  15. What does ! do?
  16. What is the difference between x += 5 and x = x + 5?
  17. What does x *= 2 do?
  18. What is the result of 20 % 6?
  19. What does a relational operator return?
  20. Why are logical operators used with conditions?

Conditional Statements

if else-if

  1. What is the purpose of an if statement?
  2. What is the difference between if-else and else-if?
  3. What is a nested if statement?
  4. Why should higher grade thresholds be checked first?
  5. Can an if statement exist inside another if statement?
  6. What happens when every condition in an if-else-if ladder is false and no final else is provided?