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 737 students.
Show answer
Correct answer: A
The worked solution is available to enrolled students.
Video solution available to enrolled students.
Explore the full course: Iocl Engineers Officers Grade A Paper 2
Loading lesson…