Lesson 7 of 34

else if: പല തിരഞ്ഞെടുപ്പുകൾ

8 min 25 XP

രണ്ടിലധികം തിരഞ്ഞെടുപ്പുകളുണ്ടെങ്കിൽ else if ഉപയോഗിക്കൂ. Java മുകളിൽ നിന്ന് താഴേക്ക് പരിശോധിച്ച്, condition true ആയ ആദ്യ block മാത്രം പ്രവർത്തിപ്പിക്കുന്നു.

Example: edit me and press Run

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

ക്രമം പ്രധാനമാണ്! ഏറ്റവും വലിയ range ആദ്യം പരിശോധിക്കൂ. temp >= 15 ആദ്യം വന്നാൽ 40-നും "Pleasant" എന്ന് print ആകും.

Challenge

+25 XP

മാർക്ക് വായിച്ച് grade print ചെയ്യൂ: 90+ → A, 75–89 → B, 50–74 → C, 50-ൽ താഴെ → D

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