Decision Making Questions
Decision Making Questions
Write a C program that takes the marks of a student as input and prints the corresponding grade
based on the following criteria:
● 90-100: Grade A
● 80-89: Grade B
● 70-79: Grade C
● 60-69: Grade D
● Below 60: Fail
Write a C program to check if a given year is a leap year. A year is a leap year if:
● It is divisible by 4
● It is not a century year unless it is divisible by 400
Write a C program that takes a day number (1 to 7) as input and prints the corresponding day of
the week. Use a switch statement.
Write a C program to find the maximum of two numbers using the ternary operator.
Write a C program to check whether a given character is a vowel or a consonant using the switch
case.
Write a C program to calculate the electricity bill based on the following rules:
● For the first 100 units: ₹1.50/unit
● For the next 100 units: ₹2.50/unit
● Above 200 units: ₹3.50/unit Use if-else if to implement the logic.
Write a C program to check if a person is eligible to vote based on their age. A person is eligible
to vote if they are 18 years or older.