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]=44ar[3]=33ar[3]=55ar[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 [पृष्ठ १७३]
