For Loop Programming

For Loop Programming

  1. Write a program to print all natural numbers from 1 to n.
  2. Write a program to print all natural numbers in reverse (from n to 1)
  3. Write a program to print all alphabets from a to z.
  4. Write a program to print all even numbers between 1 to 100.
  5. Write a program to print all odd numbers between 1 to 100.
  6. Write a program to find the sum of all natural numbers between 1 to n.
  7. Write a program to find the sum of all even numbers between 1 to n
  8. Write a program to find the sum of all odd numbers between 1 to n
  9. Write a program to print a multiplication table of any number.
  10. Write a program to print all ASCII characters with their values
  11. Write a program to find the power of a number using for loop
  12. Write a program to find all factors of a number
  13. Write a program to calculate the factorial of a number
  14. Write a program to find the HCF (GCD) of two numbers
  15. Write a program to find the LCM of two numbers
  16. Write a program to check whether a number is a Prime number.
  17. Write a program to print all Prime numbers between 1 to n.
  18. Write a program to find the sum of all prime numbers between 1 to n
  19. Write a program to find all prime factors of a number
  20. Write a program to check whether a number is a Perfect number or not
  21. Write a program to print all Perfect numbers between 1 to n.