Activity 2 - Feb 2, 2026


While-Loop

The value of x isL 1
The value of x isL 2
The value of x isL 3
The value of x isL 4
The value of x isL 5
The final value of x after looping is 6

For-Loop

First for loop example:
The value of i is: 0
The value of i is: 10
The value of i is: 20
The value of i is: 30
The value of i is: 40
The value of i is: 50
The value of i is: 60
The value of i is: 70
The value of i is: 80
The value of i is: 90
the final value of i 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

**********
**********
**********
**********
**********
This is the 2nd nested loop example
*
**
***
****
*****
This is the 3rd nested loop example
*****
******
*******
********
*********
**********
***********

Functions

First call to drawTrapezoid function
####
#####
######
#######
########

Add Style

#####
######
#######
########
######
#######
########
##
###
####
#####
######
#######
########

Submitted by [Your Name]