What is the output of the following code?
int a[ ] = {1, 1, 2, 3, 5, 8, 13, 21);
for (int n = 0; n < 5; n++) {
a[n] = a (n+1);
a [n+1) = a (n+2];
a [n+2) = a (n+3];
a [n+3] = a[n] + a[n+1) + a[n+2];
}
System.out.println(a[7]);
Answers
Answered by
0
Answer:
a[7] = 76
Explanation:
In the image,i have trying to show how programme execute step by step.
Hope it helps.
Please mark brainlist
Attachments:
Similar questions