हिंदी

If a = 12, give the value of the following expression: a + = 2;

Advertisements

प्रश्न

If a = 12, give the value of the following expression:

a + = 2;

लघु उत्तरीय
Advertisements

उत्तर

Given: a = 12

Expression: a + = 2;

In Java, the addition assignment operator must be written as += without a space between + and =.

Therefore, the given expression causes a compilation error.

  • Value of expression (a + = 2) = Compilation error
  • New value of a = Not applicable (program does not compile)
 
shaalaa.com
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 6: Variables and Expressions - EXERCISE [पृष्ठ १३५]

APPEARS IN

धीरज मेहरोत्रा Computer Science [English] Class 12
अध्याय 6 Variables and Expressions
EXERCISE | Q a. (d) | पृष्ठ १३५
Advertisements
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×