मराठी

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×