Loops

for loop

while and do loops

break and continue


Exercises

  1. Write a for loop to caculate the sum of numbers from 10 to 20.
  2. Write another loop to caculate the sum of even numbers from 2 to 100.