Iteration Worksheet 1 - Answers
1. Write a program that uses a for loop to print the numbers from 1 to 10.2. Modify the previous program to print only the even numbers from 1 to 10.3. Create a program that calculates the sum of all the numbers from 1 to 100 using a while loop.4. Extend the previous program to calculate the sum of all the even numbers from 1 to 100.5. Write a program that prints the first 10 terms of the Fibonacci sequence using a for...
To access the contents of this site, you must subscribe.