Maria is writing a program to print numbers from 1 to 10. Which loop would be the most straightforward for this purpose?

  • do-while loop
  • for loop
  • switch loop
  • while loop
Maria should use a for loop for this task. A for loop is designed for iterating over a range of values, making it the most straightforward choice for printing numbers from 1 to 10. It allows precise control over the iteration.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *