Example of While Loop:
Q1: Write a program to display a “Pakistan Zinda Bad” three times and “Pakistan Painda Bad” one time.
Q2: Write a program which can gets starting and ending point from the user and generate a sequence
of natural number from start point to end point in reverse order and their sum and product.
Example of do-while loop:
Q1:This program inputs two numbers from user and display the result as first number raise to the power
of second number using do-while loop
Example of For loop:
Q1:Write a program which can gets starting and ending point from the user and generates a table using
for loop.
Q1:Write a program using nesting loops to produce a shape with asterisks as below
@@@@@@@@@@
@@@@@@@@@
@@@@@@@@
@@@@@@@
@@@@@@
@@@@@
@@@@
@@@
@@
@@
@@@
@@@@
@@@@@
@@@@@@
@@@@@@@
@@@@@@@@
@@@@@@@@@
@@@@@@@@@@
@@@@@@@@@@@