Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

c code to grade marks

#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+");
    }
}
Source by tutorial.techaltum.com #
 
PREVIOUS NEXT
Tagged: #code #grade #marks
ADD COMMENT
Topic
Name
9+4 =