DEV Community

umida5
umida5

Posted on

Operators (if,else if,ternary operator,switch)

int score = 85;

if(score >= 90)
{
     Console. WriteLine("A");
}
else if(score >= 80)
{
     Console-WriteLine("B");
}
else if(score >= 70)
{
     Console. WriteLine("C");
}
else
{
     Console. WriteLine("F");
}
Enter fullscreen mode Exit fullscreen mode

Natija: B chunki 85 90 dan kichik birinchi if da false beradi va else if ni sharti true bo'lib 85 80 katta bo'lgani uchun javob B.

Top comments (0)