SORTINGC - mat[a+1][b]=mat[a][b]; mat[a][b]=temp; } } } }...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
//sorting coloumn vise// #include<stdio.h> #include<conio.h> # void main (void) { // intializing of matrix// int mat[4][4]={ {9,0,6,2}, {0,1,8,7}, {1,4,0,7}, {7,3,7,9} }; int a,b,c,temp; clrscr(); // for sorting of a matrix // for(c=0;c<3;c++) { for(a=0;a<3;a++) { for(b=0;b<4;b++) { if(mat[a+1][b]<mat[a][b]) { temp=mat[a+1][b];
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: mat[a+1][b]=mat[a][b]; mat[a][b]=temp; } } } } // sorted o/p // for(a=0;a&lt;4;a++) { printf(&quot;\xb3&quot;); //for matrix looks as a matrix // for(b=0;b&lt;4;b++) { printf(&quot; %d &quot;,mat[a][b]); } printf(&quot;\xb3&quot;); //for matrix looks as a matrix // printf(&quot;\n&quot;); } getch(); }...
View Full Document

Ask a homework question - tutors are online