I Haz Codes
How can counter controlled loops be used to solve basic problems? In this lesson we will look at how you can apply basic problem solving skills to loop problems. I give you a three step solution to using counter controlled loops.
Write a program that will add up the numbers 1 to 100 and then display the answer. The calculation should be 1+2+3+4+5…+98+99+100.
You will need an extra variable called total which starts at 0.
The following series of numbers is called the Fibonacci Series (discovered by Leonardo Pisano Bigollo aka Fibonacci).
0,1,1,2,3,5,8,13, 21, 34, 55
Write a program to generate this famous sequence of numbers.