Question
Grading System Based on Marks.
Solution
β Verified
#include <stdio.h>
int main() {
int marks;
printf("Enter your marks (0 - 100): ");
scanf("%d", &marks);
if (marks >= 90)
printf("Grade: A\n");
else if (marks >= 80)
printf("Grade: B\n");
else if (marks >= 70)
printf("Grade: C\n");
else if (marks >= 60)
printf("Grade: D\n");
else if (marks >= 40)
printf("Grade: E\n");
else
printf("Grade: F (Fail)\n");
return 0;
}
Click here to download practice questions on
If Else StatementMore Questions on If Else Statement
Question 2
Check if a person can vote and also check if they are a senior citizen using nested if.
View solution
Question 8
Write a program in C to Check whether a character is uppercase or lowercase.
View solution
Question 12
Write a program in C to Check if a person is eligible to vote by checking his or her age.
View solution