A2 Loops
A2 Loops
Task 4 - 4/10/2024
1. Print the factorial of a given number using a while loop.
2. Find the product of all numbers between 1 and 10 using a for loop.
3. Print the first 10 Fibonacci numbers using a while loop.
4. Print the reverse of a given number using a for loop.
5. Print the first 10 odd numbers using a for loop.
6. Calculate the sum of numbers from 1 to 50 using a for loop.
7. Print the multiplication table of 7 using a for loop.
8. Write a program to reverse a given number using a for loop.
9. Print the first 15 terms of the Fibonacci series using a for loop.
10. Print all natural numbers between 1 and 100 that are divisible by 5 using a for
loop.
11. Write a program to print the ASCII values of characters from 'A' to 'Z' using a
for
loop.
12. Write a program to count the number of digits in a number using a for loop.
13. Print the sum of the squares of the first 20 natural numbers using a for loop.
14. Print all numbers between 1 and 100 that are divisible by both 3 and 7 using a for
loop.
15. Check whether a given number is an Armstrong number using a for loop.
16. Calculate the sum of the digits of a given number using a for loop.
17. Print all natural numbers between 1 and 100 that are divisible by 5 using a for
loop.
18. Write a program to print the ASCII values of characters from 'A' to 'Z' using a
for
loop.
19. Print below patterns:
1 *****
12 ****
123 ***
1234 **
*
1 *
121 **
12321 ***
1234321 ****
12321 *****
121
1
5 A
44 A
333 B
2222 ABC
ABC
11111
D
A
BB
CC 1
C 11
12 1
DDDD 1331