हिंदी

Given: int ta[ ] = {11, 22, 33, 44, 55}; ar[3]+= ar[2]; System.out.print(“ ar[3]=" + ar[3]); The output will be ______.

Advertisements
Advertisements

प्रश्न

Given:

int ta[ ] = {11, 22, 33, 44, 55};
ar[3]+= ar[2];
System.out.print(“ ar[3]=" + ar[3]);

The output will be ______.

विकल्प

  • ar[3]=44

  • ar[3]=33

  • ar[3]=55

  • ar[3]=77

MCQ
रिक्त स्थान भरें
Advertisements

उत्तर

The output will be ar[3]=77.

Explanation:

  • Value Lookup: Based on zero-indexing, ar[2] equals 33 and ar[3] equals 44.
  • Addition Step: The expression ar[3] + = ar[2] performs 44 + 33, updating ar[3] to 77.
  • Final Print: The print statement displays the text directly with the newly updated value.
shaalaa.com
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 7: Arrays - One Dimension - Exercises [पृष्ठ १७३]

APPEARS IN

रुपा पंडित Computer Applications [English] Class 10 ICSE
अध्याय 7 Arrays - One Dimension
Exercises | Q 1. (vi) | पृष्ठ १७३
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×