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.