For Loop


Q1. Write a program that print numbers from 1 to 10.
Q2. Write a program that print numbers from 10 to 1.
Q3. Write a program that prints numbers from -100 to 100.
Q4. Write a program that print alphabets from a to z.
Q5. Write a program that print alphabets from z to a.
Q6. Write a program to display a table of equivalent temperature in both Fahrenheit and Celsius with an increment of 5 from 50 to 100. Formula: C=5/9(F-32)
Q7. Write a program that inputs a number from the user using for loop. It displays the number if it is greater than 0 otherwise it inputs next number using continue.
Q8. Write a program the display the sum of the following series 1+3+5+7+…..+100.
Q9. Write a program that print all the positive number less then 15,skipping those that are greater than 5 and less than 10 i.e. 6,7,8 and 9 are not printing
Q10. Write a program that prints all positive numbers up to 50 skipping those that are divisible by 5 using continue statement.
Q11. Write a program that inputs number from the user using for loop. If the number is greater than 0, it displayed and the next number is input. The program exits the loop if the number is 0 or negative using breaks statement.
Q12. Write a program that inputs an integer and prints if it is prime or composite. A number is prime if it has factors 1 and itself, otherwise it is a composite number.
Q13. Write a program that produce the output

1

1 2

1 2 3

1 2 3 4

1 2 3 4 5

Q14. Write programs that print the series in reverse order.

Q15.

*

**

***

****

Q16.

****

***

**

*