60 314
Assignments Done
98,1%
Successfully Done
In April 2018

Answer to Question #68234 in Java | JSP | JSF for art

Question #68234
public class P15 {
public static void main(String[] args) {
int[] v = { 0, 1, 2, 3 };
System.out.println(v[1] + ", " + v[2] + ", " + v[3]);
fiddle(v, v[2]);
System.out.println(v[1] + ", " + v[2] + ", " + v[3]);
fiddle(v, v[3]);
System.out.println(v[1] + ", " + v[2] + ", " + v[3]);
}

public static void fiddle(int[] array, int idx) {
array[idx] = array[idx - 1] + array[idx - 2];
}
}
Expert's answer
Output of this program is:

1, 2, 3

1, 1, 3

1, 1, 2

Method fiddle change the index.

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions