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

  1. A.

    0

  2. B.

    n−1

  3. C.

    n² − 3n + 2

  4. D.

    n²(n+1)/2

Attempted by 806 students.

Sign up free to check your answer

Sign up free

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…