An n × n array v is defined as follows: v[i, j] = i − j for all i, j, 1 <= i…
GATE · 2000 · CS · Question 1 subparts
An n × n array v is defined as follows:
v[i, j] = i − j for all i, j, 1 <= i <= n, 1 <= j <= n
The sum of the elements of the array v is
- A.
0
- B.
n−1
- C.
n² − 3n + 2
- D.
n²(n+1)/2
Attempted by 806 students.
Sign up free to check your answer
Sign up freeLoading lesson…