Answer to Question #68234 in Java | JSP | JSF for art
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];
}
}
1
2017-05-22T12:08:10-0400
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!
Learn more about our help with Assignments:
JavaJSPJSF
Comments
Leave a comment