C Program to grade calculation system
Get a mark of a student and find its grade. (Note: 96 to 100 - O Grade 91 to 95 - A Grade 81 to 90-B Grade 71 to 80 - C Grade 61 to 70 - D Grade 50 to 60 - E Grade Below 50 - F Grade)
Sample Input 1:
75
Sample Output 2:
C
Flow Chart Design
Try your Solution
Strongly recommended to Solve it on your own, Don't directly go to the solution given below.
#include<stdio.h>
int main()
{
//write your code here
}
Program or Solution
#include<stdio.h>
int main()
{
int mark;
printf("Enter a number:");
scanf("%d",&mark);
if(mark>95&&mark<=100)
{
printf("O Grade");
}
else if(mark>90&&mark<=95)
{
printf("A grade");
}
else if(mark>80&&mark<91)
{
printf("B Grade");
}
else if(mark>70&&mark<81)
{
printf("C Grade");
}
else if(mark>60&&mark<71)
{
printf("D Grade");
}
else if(mark>49&&mark<61)
{
printf("E Grade");
}
else if(mark>=0&&mark<50)
{
printf("F Grade");
}
else
{
printf("Invalid Mark");
}
return 0;
}
Program Explanation
chained conditional check is used here to check the mark range. any one of the grade will be displayed.Comments
Related Programs
- C Program to calculate discount for purchase above 5000
- C Program to find greatest among two numbers
- C Program to find smallest among two numbers
- C Program to find whether the given number is odd or even number
- C Program to find whether the difference between two numbers is even or odd
- C Program to find whether the given number is 3 digit number or not
- C Program to find greatest among three numbers
- C Program to find smallest among three numbers
- C Program to find whether the given number is divisible by 3
- C Program to find whether the given year is leap year or not
- C Program to find whether the last digit of given number is divisible by 3
- C Program to Arithmetic Calculator using switch case Statements
- C Program to find the whether the last digit of given two numbers are equal or not
- C Program to calculate different discount for different Bill amount
- C Program to check whether ith bit in a number N is set or not
- C Program to check odd or even using bitwise operator
coming Soon
coming Soon