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) రెండు దశాంశ స్థానాలతో ప్రింట్ చేస్తుంది. %n అంటే కొత్త లైన్.