Question: 18. (5 marks) Consider the following Java code. public static void main(String[] args) { int a new int [3]; int size = 0%;B init
18. (5 marks) Consider the following Java code. public static void main(String[] args) { int a new int [3]; int size = 0%;B init (a,size); for (int i = 1; i < size; ++i) System.out.println(a[i]); System.out.println(a[0]); private static void init (int () a, int size) { for (int i = 0; i < 3; ++i) { ++size; a[i] (1-1) * size%;B Show the output produced by this algorithm. Values must be printed in the same order as the algorithm prints them.
Step by Step Solution
There are 3 Steps involved in it
Lets walk through the given Java code step by step to determine the output i... View full answer
Get step-by-step solutions from verified subject matter experts
