I want to write c program to display status of student. if student get less then 40 marks then print " Failed". if he get mark's 40-50 then print "average. if he get marks 50- 70 then print "good" if he get mark's 70-100 then print "excellent "
I was trying to write program but I am not getting status of student. How to print different status of students ?
Code:
#include<stdio.h>
int main(void)
{
int marks;
printf(" exam marks : ");
scanf("%d", &marks);
if (0 < marks && marks > 40)
{
printf ("failed");
}
else if (40 < marks && marks > 50)
{
printf ("average");
}
else if (50 < marks && marks > 70)
{
printf ("Good");
}
return 0;
}