Wednesday, May 1, 2013

Find Out the Grade Point Depending on the Marks

Program to Find Out Grade Point

Enter your marks and get your grade point by this program.

#include<stdio.h>
void main()
{
float Marks;
printf("Plz enter your marks: ");
scanf("%f",&Marks);
if(Marks>100||Marks<0)
printf("The marks is invalid");
else if(Marks>=80&&Marks<=100)
printf("You get A+");
else if(Marks>=70&&Marks<80)
printf("You get A Grade");
else if
(Marks>=60&&Marks<70)
printf("You get A-");
else if
(Marks>=50&&Marks<60)
printf("You get B ");
else if
(Marks>=40&&Marks<50)
printf("You get C Grade");
else if
(Marks>=33&&Marks<40)
printf("You get D Grade");
else
printf("You are faild");
}




Now if you enter a number suppose this number is 50. At first this number cheeked by first 'if' because of false of first if this number cheeked by second elseif, if condition true then print grade and if false this number cheeked by next elseif, when condition true then print grade. If you enter smallest or lowset number from 33 then you get print 'You are faild'.    

No comments:

Post a Comment