Lesson 4 of 34

Operators: കണക്കുകൂട്ടൽ

8 min 20 XP

Java-യിൽ + - * / % operators ഉണ്ട്. ശ്രദ്ധിക്കുക: രണ്ട് ints-നെ / കൊണ്ട് ഹരിച്ചാൽ പൂർണ്ണസംഖ്യ കിട്ടും, ദശാംശഭാഗം പോകും. % ശിഷ്ടം നൽകുന്നു.

Example: edit me and press Run

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

ദശാംശ ഉത്തരം വേണമെങ്കിൽ (double) ഉപയോഗിച്ച് cast ചെയ്യൂ. x += 5 എന്നത് x = x + 5-ന്റെ ചുരുക്കമാണ്. x++ ഒന്ന് കൂട്ടുന്നു, x-- ഒന്ന് കുറയ്ക്കുന്നു.

Example: edit me and press Run

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

printf("%.2f%n", value) രണ്ട് ദശാംശസ്ഥാനങ്ങളോടെ print ചെയ്യുന്നു. %n എന്നാൽ പുതിയ വരി.

Challenge

+20 XP

മിനിറ്റുകളുടെ എണ്ണം വായിച്ച് അത് മണിക്കൂറും മിനിറ്റുമായി print ചെയ്യൂ. Input: 135 → Output: 2 hours 15 minutes

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