Home / EG Comp Lab / C Language / Get Marks according to Grade: C Program

Get Marks according to Grade: C Program

Here is a code that accepts marks of students and display the grade according to student’s marks.
Normaly each university has its own grade system,below we take one example of marks distributed according to garade.Here this Program using if-else if ladder statement.

Marks         Grade

100-80        Distinction
60-79          First Class
35-59          Second Class
0-34            Fail
[message_box title=”Program ” color=”red”]

/* Write a program to read marks from keybord and your program should display equivalent grade according to table */

/* Written by Utpal Chaudhary */

/*Student of L.D COLLEGE OF ENGINEERING,Ahmedabad-15,Gujarat */

#include <stdio.h>
#include <conio.h>

void main()
int m;

printf (“Enter marks:”);


if(m>=80 && m<=100)
printf (“Distinction”);

else if(m>=60 && m<80)
printf(“First Class”);

else if(m>=35 && m<60)
printf(“Second Class”);

else if(m>=0 && m<35)


[/message_box] [message_box title=”Output 1″ color=”red”]

Enter marks:85

[/message_box] [message_box title=”Output 2″ color=”red”]

Enter marks:40
Second Class


About EngineersGallery

Check Also

Game-Theoretic Pricing for Video Streaming in Mobile Networks

ABSTRACT Mobile phones are among the most popular consumer devices, and the recent developments of …

Leave a Reply

Be the First to Comment!

Notify of