C_Tutorial_If_Else_Questions
C_Tutorial_If_Else_Questions
ar
Sh
C Tutorial: Basic If-Else Questions
m
1. Write a program that takes an integer as input and checks whether it is even or odd.
ha
2. Write a program to input a number and check whether it is positive, negative, or zero.
3. Write a program to input two integers and print the largest of the two.
ub
4. Write a program that takes a person's age as input and checks if they are eligible to vote (age >=
18).
Sh
5. Write a program to input a number and check if it is divisible by 5 and 11.
7. Write a program that takes a character as input and checks whether it is a vowel or consonant
8. Write a program to check if a number is odd or even without using the modulus operator (%).
9. Write a program to input three angles of a triangle and check if it is valid (sum of angles = 180).
10. Write a program to input marks of a student and assign grades based on the following: