If-else Pragrams
1.Write a C program to check whether a number is positive, negative, or zero.
2.Write a program that checks if a number is even or odd using if-else.
3.Write a C program to find the greater of two numbers using if-else.
4.Write a program to find the largest among three numbers using if-else.
5.Write a program to check if a year is a leap year or not.
6.Write a program that takes a student’s marks as input and prints “Pass” if marks are greater than or equal to 40, otherwise “Fail”.
7.Write a program to check whether a character is a vowel, consonant, digit, or special character.
8.Write a program to check if the entered character is an alphabet or not.
9.Write a program that takes two numbers and a character as an operator (+, -, *, /) and performs the corresponding operation using if-else.
10.Write a program that takes marks as input and prints the grade:
90–100: Grade A
75–89: Grade B
60–74: Grade C
40–59: Grade D
Below 40: Fail