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

后端 未结 4 1794
庸人自扰
庸人自扰 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:32

    That is not a real operator:

    !>
    

    Not Greater Than would be <= (Less Than or Equal To)

    EDIT: What you are trying to say could actually also be expressed using the ! operator. But it would be

    !(marks > 100 )
    

提交回复
热议问题