0% found this document useful (0 votes)
5 views1 page

Print

The document outlines a series of programming tasks involving loops in various programming languages. It includes instructions for printing sequences, calculating sums and products, and checking conditions based on user input. The tasks utilize different types of loops such as for, while, and do-while to achieve the desired outputs.

Uploaded by

Sabka Baap
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views1 page

Print

The document outlines a series of programming tasks involving loops in various programming languages. It includes instructions for printing sequences, calculating sums and products, and checking conditions based on user input. The tasks utilize different types of loops such as for, while, and do-while to achieve the desired outputs.

Uploaded by

Sabka Baap
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

1. Print "Hello, World!" 10 times using a for loop.

2. Print numbers from 1 to 10 using a while loop.


3. Print numbers from 10 to 1 using a do-while loop.
4. Take a number n from the user and print numbers from 1 to n using a for loop.
5. Print even numbers from 2 to 20 using a while loop.
6. Print odd numbers from 1 to 19 using a for loop.
7. Calculate the sum of numbers from 1 to 10 using a for loop.
8. Take a number n and calculate the sum of numbers from 1 to n using a while loop.
9. Print the first 10 multiples of 5 using a for loop.
10. Print numbers from 1 to 100 that are divisible by 3 using a while loop.
11. Take a number n and print its multiplication table up to 10 using a for loop.
12. Count down from 20 to 1 using a do-while loop.
13. Print numbers from 1 to 50 that are not divisible by 4 using a for loop.
14. Take a number n and print "C is fun!" n times using a while loop.
15. Calculate the product of numbers from 1 to 5 using a for loop.
16. Print the squares of numbers from 1 to 10 using a while loop.
17. Print the cubes of numbers from 1 to 5 using a do-while loop.
18. Take a number n and check if it’s even or odd for numbers 1 to n using a for loop.
19. Print numbers from 1 to 20, skipping multiples of 3 using a continue statement in a
for loop.
20. Take a number n and stop printing numbers from 1 to 100 when you reach n using a
break statement in a while loop.
21. Print the first 10 Fibonacci numbers using a for loop.
22. Calculate the factorial of a number n using a while loop.
23. Print numbers from 1 to 15 in reverse order using a for loop.
24. Take a number n and print its powers (n^1, n^2, n^3) up to n^5 using a for loop.
25. Count how many numbers from 1 to 100 are divisible by 7 using a while loop.
26. Print "Looping..." 5 times, then stop using a do-while loop.
27. Take a number n and print all numbers from 1 to n that are multiples of both 2 and 3.
28. Print the sum of even numbers from 1 to 20 using a for loop.
29. Print numbers from 1 to 10 and their remainders when divided by 3 using a while
loop.
30. Take a number n and print "Odd" or "Even" for each number from 1 to n using a for
loop.

You might also like