# includeint i, j; float mat[10][10]; void Traverse ( int, int); void input( int, int); void Traverse (int row, int col) { printf("\n Traversing in row major order\n"); for( i = 0; i < row; i++) { for( j = 0; j < col; j++) { printf("\n 0x%x", &mat[i][j]); printf(" %f", mat[i][j]); } printf("\n"); } printf("\n Traversing in column major order\n"); for(j = 0; j < col; j++) { for(i = 0; i < row; i++) { printf("\n 0x%x", &mat[i][j]); printf(" %f", mat[i][j]); } printf("\n"); } printf("\n Traversing in row major order\n"); for(i = 0; i < row; i++) { for(j = 0; j < col; j++) { printf(" mat[%d][%d] = ", i, j); printf("%f", mat[i][j]); } printf("\n"); } printf("\n Traversing in column major order\n"); for(j = 0; j < col; j++) { for(i = 0; i < row; i++) { printf(" mat[%d][%d] = ", i, j); printf("%f", mat[i][j]); } printf("\n"); } } void input(int row, int col) { for(i = 0 ; i< row; i++) { for(j = 0 ; j
C program for TRAVERSING A TWO DIMENSIONAL ARRAY
Next Article to Read
Among many other career blogs, Fun-The-Mentals is a different blog to help students achieve their goals.. This blog is maintained by Debashish and group. The blog is intended to bring decent and genuine information to the students of colleges and universities to help their preparation for job in the competitive world.
Add on Facebook
?
0 comments:
Post a Comment