मराठी

Which of the answers does the same thing as the following: value += sum++;

Advertisements

प्रश्न

Which of the answers does the same thing as the following:

value += sum++;

पर्याय

  • value = value + sum;
    sum = sum + 1;

  • sum = sum + 1;
    value = value + sum;

  • value = value + sum;

  • value = value + ++sum;

MCQ
Advertisements

उत्तर

value = value + sum;
sum = sum + 1;

Explanation:

The statement value += sum++; first adds the original value of sum to value and then increments sum by 1.

shaalaa.com
  या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
पाठ 6: Variables and Expressions - EXERCISE [पृष्ठ १३३]

APPEARS IN

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

Englishहिंदीमराठी


      Forgot password?
Use app×