if语句的C ++多个条件

2022-01-20 00:00:00 conditional-statements c++

任何人都知道为什么这不起作用.我应该如何满足多个条件.

Anyone know why this wont work. How am I supposed to put in multiple conditions to be met.

    else if (studentoverall < 90; studentoverall>=80)
    {
        lettergrade = "B";
    }

推荐答案

With 逻辑与(&&):

With Logical AND (&&):

else if (studentoverall < 90 && studentoverall >= 80)

相关文章