Rewrite the following by using ternary operator.
If(marks >=90)
Res="Grade A";
Else If(marks>=80)
Res=""Grade B";
Else
Res="Grade C";
Answers
Answered by
3
Res = (marks>=90)?"Grade A":(marks>=80)?"Grade B":"Grade C";
Read my bio once
Similar questions