Simple C Programming Questions Using if and if-else
1. Write a C program to check if a number is positive.
2. Write a C program to check if a number is even or odd.
3. Write a C program to check if a number is zero or non-zero.
4. Write a C program to find the greatest of two numbers.
5. Write a C program to check if a number is divisible by 5.
6. Write a C program to check if a character is an uppercase letter.
7. Write a C program to check if a number is positive, negative, or zero.
8. Write a C program to check if a year is a leap year.
Hint: A year is a leap year if it is divisible by 4 and not divisible by 100, or if it is
divisible by 400.
9. Write a C program to check if a student passed or failed (pass mark = 40).
10. Write a C program to check if a number is in the range 10 to 100.