Operator '&&' cannot be applied to operand of type 'bool' and 'int'

后端 未结 4 1796
庸人自扰
庸人自扰 2021-01-12 10:49

I have an if elseif statement to check marks and grade the marks according to the condition.

int marks;
string grade;

if (marks>=80 && marks!>         


        
4条回答
  •  再見小時候
    2021-01-12 11:10

    int marks;
    string grade;
    
    if ((marks>=80) && !(marks > 100))
    {
    grade = "A1";
    }
    else if ((marks>=70) && !(marks > 79))
    {
    grade = "A2";
    }
    

提交回复
热议问题