C program to find grade of a student
A student's grade is calculated in a subject according to the understated rules. Write a program which accepts a student's number as input and then determine the grade of the students in that subject.
C program to find grade of a student
---------------------------------------------------------------------------------------#include<stdio.h>
void main()
{int m;
printf("Enter your marks");
scanf("%d",&m);
if(m>=90&&m<=100)
printf("Your grade is O");
else if(m>=80&&m<90)
printf("Your grade is E");
else if(m>=70&&m<80)
printf("Your grade is A");
else if(m>=50&&m<60)
printf("Your grade is C");
else if(m>=40&&m<50)
printf("Your grade is D");
else if(m<40&&m>=0)
printf("Your grade is F. YOU FAILED!!");
else
printf("Invalid Input");
}
------------------------------------------------------------------------------------
Just copy and paste the program in your desired compiler (Dev C++ is more preferable) and run it.
Enjoy programming in C.
0 comments:
Post a Comment