[C program design] Given a 100-point grade, it is required to output the grades of "excellent", "good", "medium", "pass", and "fail". More than 90 points are "pass", 80~89 points are "good"......

Use C language to design a program to implement, and give a 100-point scale, "excellent", "good", "medium", "pass", and "fail". A score above 90 is considered "excellent", 80-89 is considered "good", 70-79 is considered "medium", 60-69 is considered "pass", and below 60 is "failed".

The source code is as follows:

#include <stdio.h>
int main()
{
    printf("请输入你的分数\n");
    float a;
    scanf ("%f",&a);
    if (a>=90)
        printf ("优秀\n");
    if (a>=80 && a<=89)
        printf ("良好\n");
    if (a>=70 && a<=79)
        printf ("中等\n");
    if (a>=60 && a<=69)
        printf ("及格\n");
    if (a<60)
        printf ("不及格\n");
    return 0;
}

Guess you like

Origin blog.csdn.net/weixin_61536532/article/details/121630838