Activity 2 - Feb 2, 2026
While Loop
The value for my variable x is 1
The value for my variable x is 2
The value for my variable x is 3
The value for my variable x is 4
The value for my variable x is 5
The final value for x after the while loop is 6.
For Loop
First For Loop Example
The value for variable x is 0
The value for variable x is 10
The value for variable x is 20
The value for variable x is 30
The value for variable x is 40
The value for variable x is 50
The value for variable x is 60
The value for variable x is 70
The value for variable x is 80
The value for variable x is 90
The final value for x after the for loop is 100.
The second looping example is to calculate 1+2+3+...+100
The sum of 1+2+3+...+100 = 5050
Nested Looping
The 1st nested looping example
**********
**********
**********
**********
**********
The 2nd nested looping example
*
**
***
****
*****
The 3rd nested looping example
****
*****
******
*******
********
*********
**********
Functions
$$$$
$$$$$
$$$$$$
$$$$$$$
$$$$$$$$
$$$$$$$$$
$$$$$$$$$$
Add Some Style
&
&&
&&&
&&&&
&&&&&
&&&&&&
&&&&&&&
&&&&&&&&
&&&&&&&&&
&&&&&&&&&&
&
&&
&&&
&&&&
&&&&&
&&&&&&
&&&&&&&
&&&&&&&&
&&&&&&&&&
&&&&&&&&&&
&
&&
&&&
&&&&
&&&&&
&&&&&&
&&&&&&&
&&&&&&&&
&&&&&&&&&
&&&&&&&&&&
Submitted by Calina Winfield