C++ Loops

Last Updated :
Discuss
Comments

Question 1

Which loop guarantees at least one iteration?

  • for

  • while

  • do-while

  • All of the above

Question 2

What does the break statement do in a loop?

  • Skips to the next iteration

  • Exits the loop

  • Restarts the loop

  • Pauses the loop

Question 3

What is the purpose of a continue statement?

  • Exits the loop

  • Skips the current iteration

  • Defines a condition

  • Allocates memory

Question 4

Which loop is best for a fixed number of iterations?

  • while

  • do-while

  • for

  • None

Question 5

What causes an infinite loop?

  • Missing break

  • Incorrect condition

  • Missing continue

  • Wrong variable type

Tags:

There are 5 questions to complete.

Take a part in the ongoing discussion