You are on page 1of 3

For loop:-

1. program to print all natural numbers from 1 to n


2. program to print natural numbers in reverse from n to 1
3. program to print alphabets from a to z
4. program to print all even numbers from 1 to 50
5. program to print all odd numbers from 1 to 50
6. program to find sum of natural numbers from 1 to n
7. program to find sum of odd numbers from 1 to n
8. program to print multiplication table of a given number
Input
Input num: 5
Output
5 * 1 = 5
5 * 2 = 10
5 * 3 = 15
5 * 4 = 20
5 * 5 = 25
5 * 6 = 30
5 * 7 = 35
5 * 8 = 40
5 * 9 = 45
5 * 10 = 50
9. program to find first and last digit of any number
10. program to check whether a number is palindrome or not

do while loop:-
1. program to count number of digits in an integer
2. WAP to read numbers while numbers entered is not equals
to zero. And find sum of all numbers entered.
3. WAP to read numbers while numbers entered is not equals
to zero. And find sum of all Even numbers entered.
4. WAP to read number while number entered is not equals to
zero. And find sum of all even number and odd number
entered.
5. WAP to read number while number entered is not equals to
zero. And count all negative number entered.
6. WAP to read number while number entered is not equals to
zero. And count all negative number as well as positive number
entered entered .
7. WAP to print table of three using do while loop
3 6 9 12 15 18 21 24 27 30
8. Program to calculate the Simple interest.
SI = (Principal * Rate * Time) / 100
While loop:-
1. program to print all natural numbers from 1 to n
2. program to print natural numbers in reverse from n to 1
3. program to print alphabets from a to z
4. program to print all even numbers from 1 to 50
5. program to print all odd numbers from 1 to 50
6. program to find sum of natural numbers from 1 to n
7. program to find sum of odd numbers from 1 to n
8. program to print multiplication table of a given number
Input
Input num: 5
Output
5 * 1 = 5
5 * 2 = 10
5 * 3 = 15
5 * 4 = 20
5 * 5 = 25
5 * 6 = 30
5 * 7 = 35
5 * 8 = 40
5 * 9 = 45
5 * 10 = 50
9. program to find first and last digit of any number
10. program to check whether a number is palindrome or not

You might also like