1,377 views
2 2 votes

Consider the following code given below
 

int A[8][8], p, q;
for(p = 0; p < 8; ++p)
for(q = 0; q < 8; q++)
{
A[p][q] = A[q][p];
}



What will happen to matrix A ?

2 Answers

0 0 votes
symmetric matrix

p=0   for(q = 0; q < 8; q++) replace 1st row with 1st column

p=1   for(q = 0; q < 8; q++) replace 2nd row with 2nd column

and so on

try with 3*3 matrix
Position:
Show:

Related questions

0 0 votes
1 1 answer
668
668 views
jaikant asked Apr 14, 2023
668 views
I have confusion regarding pointers, why 1D array and 2D array works differently. For e.g. I have written a code#include <stdio.h>int main(){ int arr[6]={1,2,3,4,5,6};...
2 2 votes
0 0 answers
3.2k
3.2k views
Na462 asked Oct 20, 2018
3,216 views
What is the Output of following Array ? A. 8 10B. 10 8C. 10 2D. 8 1E. Garbage value
1 1 vote
1 answers 1 answer
2.9k
2.9k views
radha gogia asked Jul 10, 2018
2,887 views
If I have an array :int a [3][4] ; How to evaluate below Outputs ? 1. sizeof(*a) 2.sizeof( a) 3. sizeof(a) Please explain precisely .
2 2 votes
2 answers 2 answers
3.0k
3.0k views
jatin khachane 1 asked Jul 2, 2017
2,980 views
int b[10][10];int *a[10];//How b [3] and a [3] will work??