Define Grade Depending on Marks
#include<stdio.h>void main()
{
float num;
printf("Enter the Number: ");
scanf("%f",&num);
if(num<0||num>100)
printf("The Number is invalid, Try again");
else if(num>=80&&num<=100)
printf("You've Obtained A+ Grade");
else if(num>=70&&num<80)
printf("You've Obtained A Grade");
else if(num>=60&&num<70)
printf("You've Obtained A");
else if(num>=50&&num<60)
printf("You've Obtained B Grade");
else if(num>=40&&num<50)
printf("You've Obtained C Grade");
else if(num>=33&&num<40)
printf("You've Obtained D Grade");
else
printf("You've Obtained F Grade");
}
No comments:
Post a Comment