C Programming Exercises

  1. Write a program to print "Hello, World!" on the screen.
  2. Write a program to add two numbers entered by the user.
  3. Write a program to find the largest of three numbers.
  4. Write a program to check whether a number is even or odd.
  5. Write a program to find the factorial of a given number.
  6. Write a program to print all natural numbers from 1 to N.
  7. Write a program to calculate the sum of all numbers from 1 to N.
  8. Write a program to print the multiplication table of a given number.
  9. Write a program to check if a given number is prime or not.
  10. Write a program to find the reverse of a number.
  11. Write a program to check if a number is a palindrome.
  12. Write a program to calculate the simple interest given principal, rate, and time.
  13. Write a program to find the largest element in an array.
  14. Write a program to calculate the average of elements in an array.
  15. Write a program to copy one string into another.
  16. Write a program to count the number of vowels in a string.
  17. Write a program to print the Fibonacci series up to N terms.
  18. Write a program to swap two numbers without using a temporary variable.
  19. Write a program to convert temperature from Celsius to Fahrenheit.
  20. Write a program to find the GCD (Greatest Common Divisor) of two numbers.
  21. Write a program to check if a year is a leap year.
  22. Write a program to find the sum of digits of a number.
  23. Write a program to count the number of words in a string.
  24. Write a program to print a pattern (e.g., a pyramid or square) using loops.
  25. Write a program to demonstrate the use of a function to add two numbers.