我用if~else语句编出以下程序,能编译通过,但是得不到理想结果,希望大家能帮忙分析一下,并改正!谢谢!
#include <stdio.h>
void main()
{float a;
printf("Please input your mark:");
scanf("%f",&a);
if(90<=a<=100)
{
printf("Your grade is 'A'");
}
else if(80<=a<90)
{
printf("Your grade is 'B'");
}
else if(70<=a<80)
{
printf("Your grade is 'C'");
}
else if(60<=a<70)
{
printf("Your grade is 'D'");
}
else if(0<=a<60)
{
printf("Your grade is 'E'");
}
else if(a>100)
{
printf("Error");
}
else if(a<0)
{
printf("Error");
}
getch();
}