1.

Let A be a square matrix of size n × n. Consider the following pseudocode. What is the expected output?C = 100;for I = 1 to n dofor 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 dofor j = 1 to n dooutput (A[i] [j]);

A. The matrix A itself
B. Transpose of the matrix A
C. Adding 100 to the upper diagonal elements and subtracting 100 from lower diagonal elements of A
D. None of the above
Answer» B. Transpose of the matrix A


Discussion

No Comment Found