English

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

Advertisements

Question

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

++a

Numerical
Advertisements

Solution

Given: a = 12

Expression: ++a

The pre-increment operator first increases the value of a by 1 and then uses the updated value.

a = 12 + 1 = 13

  • Value of expression (++a) = 13
  • New value of a = 13
shaalaa.com
  Is there an error in this question or solution?
Chapter 6: Variables and Expressions - EXERCISE [Page 135]

APPEARS IN

Dheeraj Mehrotra Computer Science [English] Class 12
Chapter 6 Variables and Expressions
EXERCISE | Q 59. (b) | Page 135
Advertisements
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×