C Practice Questions with Solutions |C Programming Exercises with Solutions

1. Write a C program to check two numbers are equal or not.

Output:

2. Write a program to find the greater number among two numbers.

Output:

3. Write a C program to find maximum between two numbers.

Output:

4. Write a C program to find maximum between two numbers using conditional operator.

Output:

5. Write a C program to check whether a number is even or odd.

Output:

6. Write a C program to check whether a year is leap year or not.

Output:

7. Write a C program to classify a person’s age group and determine if they are eligible to vote. A person under 18 is a minor, between 18 and 60 is an adult, and above 60 is a senior. Only adults and seniors are eligible to vote.

Output:

8. Write a C program to find the greatest number among three numbers.

Output:

9. Write a C++ program to find the maximum of three numbers using conditional operators.

Output:

10. Write a program to input marks of three subjects of a student. Calculate total and average marks and display grade. The students get grade as per the following conditions:

Average                 Grade

90-100                  A

80-89                    B

70-79                    C

60-69                    D

0-59                      F

Output:

11. Write a C program to check a character is vowel or not using if-else.

Output:

OR

Output:

12. Write a C program to check whether a character is vowel or not using switch case.

OR

Write a C program to check whether an alphabet is vowel or not using switch case.

Output:

OR

13. Write a C program to print day of a week using switch case.

Output:

14. Write a C program to print 1st 100 natural numbers.

                              OR

Write a program in C to print the number from 1 to 100.

Output:

15. Write a C program to print alphabet from a to z.

Output:

16. Write a C program to find the sum of first n natural numbers.

Output:

17. Write a C program to print multiplication table.

Output:

18. Write a C program to print the multiplication table from 1 to 5.

Output:

19. Write a C program to print all natural numbers from 1 to n using while loop.

Output:

20. Write a C program to print alphabet from a to z using while loop.

Output:

21. Write a C program to print the elements of an array.

Output:

22. Write a C program to print the elements of an array using loop.

Output:

23. Write a C program to read and print elements of array.

Output:

24. Write a program to read an array of integers, print the same and also print the array in reverse order.

Output:

25. Write a C program to print elements of a two-dimensional array.

Output:

26. Write a C program to read and print elements of a two-dimensional array.

Output:

27. Write a C program to add two matrices.

Output:

28. Write a C program to read elements in two matrices and add elements of both matrices.

Output:

29. Write a program in C to enter emp_id, emp_name and salary of three employees and display the records using structure.

Output:

30. Write a C program to find maximum between two numbers using max() function.

Output:

Leave a Comment