हिंदी

The output of a++ will be 1, if int a = -1. - Computer Applications

Advertisements
Advertisements

प्रश्न

The output of a++ will be 1, if int a = -1.

विकल्प

  • True

  • False

MCQ
सत्य या असत्य

उत्तर

This statement is False.

Explanation:

  1. If int a = -1, then a++ is a post-increment operation. This means that the current value of a (which is -1) is used first, and then a is incremented by 1.
  2. So, the output of a++ will be -1 (the original value), and after this operation, a will become 0. 
shaalaa.com
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 1.04: Operators in Java - EXERCISES [पृष्ठ ४३]

APPEARS IN

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

Englishहिंदीमराठी


      Forgot password?
Use app×