Question: 5. Write the output for the following codes No Code Snippet a. b. int a[] = new int[5]; int i; No C. a[1] =

5. Write the output for the following codes No Code Snippet a.b. int a[] = new int[5]; int i; No C. a[1] =

5. Write the output for the following codes No Code Snippet a. b. int a[] = new int[5]; int i; No C. a[1] = 10; a[3] = 50; a[0] = a[3] / a[1]; a[4] = a[1 + 1] - a[4 - 1] + a[2]; a[2]++; for(i = 0; i < 5; i++) OBJECT ORIENTED PROGRAMMING PROGRAMMING System.out.printf("%d", a[i]); int[] a = {0, 2, 4, 1, 3}; for (int i = 0; i < a.length; i++) a[i] = a[(a[i] + 3) % a.length]; System.out.println(a[0] + a[1] + a[2] + " int[] a {10, 20, 30}; fix1(a[1]); fix(a); Code Snippet System.out.println(a[1] + a[1]); public static int fix1(int a){ a = a + 10; return a; public static void fix(int[] a){ a[1] = a[1] * 10; " " + a[3] + a[4]); Output [1 Marks] Output Page 3 of 9 CS102_ [1 Marks] [1 Marks] d. double [][] a = new double [3] [3]; for(int i = 0; i < 3; i++){ e. for(int j = 0; j < 3; j++){ a[i][j] = i + j; if(j == 1) } for(int i = 0; i < 3; i++){ for(int j = 0; j < 3; j++){ } break; } System.out.printf("%.2f ", a[i][j]); OBJECT ORIENTED PROGRAMMING PROGRAMMING System.out.println(); ArrayList items = new ArrayList (); int j = 0; for(int i = 0; i < 3; i++){ items.add(j); j+= 4; items.remove((Integer) 4); items.add(1, 10); for(Integer i : items) System.out.print(i + "); [1 Marks] Page 4 of 9 CS102 [1 Marks]

Step by Step Solution

3.40 Rating (147 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

1 Output 0 10 1 50 39 Explanation Initially all elements in the array a are 0 a1 is assigned the value 10 a3 is assigned the value 50 a0 is assigned the result of the expression a3a1 which is 5 a4 is ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Electrical Engineering Questions!