What will be the output of the following pseudocode for arr[] = {1, 2, 3, 4,…
What will be the output of the following pseudocode for arr[] = {1, 2, 3, 4, 5}? Assume 0-based indexing and n = 5.
initialize i, n
initialize an array of size n
accept the values for the array
for i = 0 to n - 2
arr[i] = arr[i] + arr[i + 1]
end for
print the array elements
- A.
3 5 7 9 5
- B.
3 5 6 7 8
- C.
3 5 9 11 15
- D.
error
Attempted by 169 students.
Sign up free to check your answer
Sign up freeLoading lesson…

