Lesson 6 of 34

if आणि else: निर्णय घेणे

8 min 25 XP

Condition true असेल तरच if कोड चालवते; नाहीतर else भाग चालतो. Condition ( ) brackets मध्ये लिहितात.

Example: edit me and press Run

Output Loading Java (first time takes a few seconds)
Press Run to see the result here.

Comparison operators: == समान, != समान नाही, > मोठे, < लहान, >= मोठे किंवा समान, <= लहान किंवा समान. प्रत्येक एक boolean (true/false) देतो.

Example: edit me and press Run

Output Loading Java (first time takes a few seconds)
Press Run to see the result here.

= value साठवतो, == तुलना करतो. यांची गल्लत करणे ही सर्वात सामान्य चुकांपैकी एक आहे.

Challenge

+25 XP

विद्यार्थ्याचे गुण वाचा. 35 किंवा जास्त असल्यास "Pass", नाहीतर "Fail" print करा.

Output Loading Java (first time takes a few seconds)
Press Run to see the result here.