Common Computer Science References
At the end of this lesson, you will be able to:
understand and use a for loop statement
boolean expressions
go over the for loop:
let the computer count for us!
go over For loops:
nil
create a program, using a for loop, that:
adds up all the numbers from 1 to the integer entered
see image below for formula, that you can use in your test cases
do the above program in PHP
n = integer you are adding to
Example: 1 + 2 + 3 + 4 + 5 = 15
15 = (5 / 2) * (5 + 1)
= (5 / 2 ) * 6
= 30 / 2
= 15