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.