Which of the following are the types of loops in C++?

  • AFor, While, Do-While
  • BIf, Else, Switch
  • CInput, Output, Print
  • DClass, Object, Function
Show answerHide answer

Correct answer A

There are 3 main types of loops in C++: For Loop (including the modern range-based for loop) While loop: repeats a statement or group of statements do-while loop: Like a while loop, except that it tests the condition at the end of the loop body.