Computer Sciences > GATE 2014 SET-3 > Matrix Operations
Let A be a square matrix of 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;
}
for i = 1 to n do
for j = 1 to n do
output(A[i][j]);
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;
}
for i = 1 to n do
for j = 1 to n do
output(A[i][j]);
Correct : a
Similar Questions
A palindrome is a word that reads the same forwards and backwards. In a game
of words, a player has the following two plates painted with letters.
From...
Which number does not belong in the series below?
2, 5, 10, 17, 26, 37, 50, 64
Choose the word that is opposite in meaning to the word “coherent”.
Total Unique Visitors
Loading......