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

AWS GenAI LIVE!

GenAI LIVE! is a dynamic live-streamed show exploring how AWS and our partners are helping organizations unlock real value with generative AI.

Tune in to the full event

DEV is partnering to bring live events to the community. Join us or dismiss this billboard if you're not interested. ❤️