blob: 297c6eded8b8f478c0509cab0d866c2f809031b0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
int main()
{
int n[3][3]={1, 2, 3, 4, 5, 6, 7, 8, 9};
int i, j, temp;
i=0;
while( i<3)
{
j=0;
while(j<3){
putint(n[i][j]);
putch(32);
j=j+1;
}
putch(10);
i=i+1;
}
i=0;
while( i<3)
{
j=0;
while(j<3){
if (j>i)
{
temp=n[i][j];
n[i][j]=n[j][i];
n[j][i]=temp;
}
j=j+1;
}
i=i+1;
}
i=0;
while( i<3)
{
j=0;
while(j<3){
putint(n[i][j]);
putch(32);
j=j+1;
}
putch(10);
i=i+1;
}
return 0;
}
|