हिंदी

Distinguish between Postfix increment and Prefix increment. - Computer Applications

Advertisements
Advertisements

प्रश्न

Distinguish between Postfix increment and Prefix increment.

अंतर स्पष्ट करें

उत्तर

S. No. Postfix increment Prefix increment
1. This operator operates on the idea of 'CHANGE BEFORE ACTION'. This operator operates on the basis of 'CHANGE AFTER ACTION'.
2. Example: 
d = 10;
t = 5 * (++d) // t = 5 * 11 = 55 
Example: 
d = 10; 
t = 5 * (d++) // t = 5 * 10 = 50
shaalaa.com
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 1.04: Operators in Java - EXERCISES [पृष्ठ ४४]

APPEARS IN

अविचल Computer Applications [English] Class 10 ICSE
अध्याय 1.04 Operators in Java
EXERCISES | Q V. 4. (b) | पृष्ठ ४४
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×