GATE CS 2014 · Set-3 · Systems of Linear Equations & Consistency

MCQ · 1 mark · Problem EM-LSYS-0023

Let A be a square matrix size n x n. Consider the following pseudocode. What is the expected output? C = 100; for i = 1 to n do for j = 1 to n do { Temp = A[ i ] [ j ] + C ; A [ i ] [ j ] = A [ j ] [ i ] ; A [ j ] [ i ] = Temp - C ; } for i = 1 to n do for j = 1 to n do output (A[ i ] [ j ]);
  1. A
    The matrix A itself
  2. B
    Transpose of the matrix A
  3. C
    Adding 100 to the upper diagonal elements and subtracting 100 from lower diagonal elements of A
  4. D
    None of these

Solve it on GATE DA practice →More Systems of Linear Equations problems

Show the worked solutionOfficial GATE Answer Key: Option A.See full step-by-step discussion on GateOverflow: https://gateoverflow.in/2044/gate2014-3-10

GATE DA practice: past exam problems by chapter, with worked solutions · gatedaprep.com