DEV Community

umida5
umida5

Posted on

1

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)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay