In this article we will check the grade of the students based on marks. first of all we will take input a mark of subject from the candidate and according to following condition we will calculate the grade.

Program to Calculate Grade According to marks

In following prgram we have taken one variabls i.e mark. We will take input from the user and using if else condition we will calculate grade. in the following program in first conditon we will print wrong entry if the marks is either less than 0 or greater than 100.


#include<stdio.h>
void main()
{
    int marks;
    printf("Enter your marks ");
    scanf("%d",&marks);
    if(marks<0 || marks>100)
    {
        printf("Wrong Entry");
    }
    else if(marks<50)
    {
        printf("Grade F");
    }
    else if(marks>=50 && marks<60)
    {
        printf("Grade D");
    }
    else if(marks>=60 && marks<70)
    {
        printf("Grade C");
    }
    else if(marks>=70 && marks<80)
    {
        printf("Grade B");
    }
    else if(marks>=80 && marks<90)
    {
        printf("Grade A");
    }
    else
    {
        printf("Grade A+");
    }
}
		


		
		grade system
		Figure 1