English

Give the output of the following program snippet: int a[4] = (2, 4, 6, 8); for (i = 0; i <= 1; i++) { s = a[i] + a[3 - i]; System.out.println(s); } - Computer Applications

Advertisements
Advertisements

Question

Give the output of the following program snippet:

int a[4] = (2, 4, 6, 8);
for (i = 0; i <= 1; i++)
{
s = a[i] + a[3 − i];
System.out.println(s);
}
Answer in Brief

Solution

10
10

shaalaa.com
  Is there an error in this question or solution?
Chapter 3: Arrays (Single Dimensional and Double Dimensional) - EXERCISES [Page 239]

APPEARS IN

Avichal Computer Applications [English] Class 10 ICSE
Chapter 3 Arrays (Single Dimensional and Double Dimensional)
EXERCISES | Q III. 4. | Page 239
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×