1.6 Exercises
- Write a piece of code that will add up all terms from one to ten.
- Write a piece of code that will add up the squares of all terms from one to ten.
- Write a piece of code that will add up the cube all terms from one to ten.
- Write a piece of code that will do the following with all numbers from one through fifty:
- Print out “Fizz” if the number is divisible by three
- Print out “Buzz” if the number is divisible by five
- Print out “FizzBuzz” if the number is divisible by both three and five
Previous
Back to Home