Lesson 8 of 34

&&, ||, !: Conditions കൂട്ടിച്ചേർക്കൽ

8 min 25 XP

&& (AND) രണ്ട് വശവും true ആകുമ്പോൾ മാത്രം true. || (OR) ഏതെങ്കിലും ഒരു വശം true ആയാൽ true. ! (NOT) true-നെ false ആയും false-നെ true ആയും മാറ്റുന്നു.

Example: edit me and press Run

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

ചെറിയ if/else ternary operator ഉപയോഗിച്ച് ഒറ്റ വരിയിൽ എഴുതാം: condition ? value1 : value2

Example: edit me and press Run

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

Challenge

+25 XP

ഒരു വർഷം വായിക്കൂ. Leap year ആണെങ്കിൽ "Leap year", അല്ലെങ്കിൽ "Not a leap year" print ചെയ്യൂ. നിയമം: 400 കൊണ്ട് ഹരിക്കാവുന്നത്, അല്ലെങ്കിൽ 4 കൊണ്ട് ഹരിക്കാവുന്നതും 100 കൊണ്ട് ഹരിക്കാനാവാത്തതും.

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