Professional Documents
Culture Documents
Fundamentals of Programming: Lab Task 5
Fundamentals of Programming: Lab Task 5
Lab Task 5
Q1) Write a program that produces the following output on screen by using nested loop.
1
2
3
4
1
2
3
4
1
2
3
4
Q2) Write a program that produces the following output on screen by using nested loop.
1
2
3
4
1
2
3
1
2
1
Q3) Write a program that produces the following output on screen by using nested loop.
5 1
5 2
5 3
5 4
4 1
4 2
4 3
3 1
3 2
2 1
Q4) Using a nested loop generate a “leaning tree” similar to the one below.
1. For input of 5:
5
54
543
5432
54321
2. For input of 5:
1
22
333
4444
55555