Recursion, Searching, Sorting, and Pointers/assign_1.c
void displayMatrix(const int A[][COL]){
    puts("");

    //traverses and displays matrix
    for (int i = 0; i < ROW; i++){
        
        //prints column header
        if (i == 0){
            printf(" %3s  ", " ");
            for (int j = 0; j < COL; j++){
                printf(" %3d ", j);
            }
            
            puts("");
            
            printf(" %3s  ", " ");
            for (int j = 0; j < COL; j++){
                printf(" %3s ", "V");
            } 
        }
        
        //prints the value of the matrix at the index
        for (int j = 0; j < COL; j++){
            if (j % COL == 0){
                puts("");
                printf(" %3d %s", i, ">");  //prints row header
            }
            printf(" %3d ", A[i][j]);
        } 
    }
    
    puts("");
}
/*
    displayMatrix: displays the values of matrix
    input: the array to be displayed (A)
*/
displays the values of matrix
input: the array to be displayed (A)
displays the values of matrix input : the array to be displayed ( A )
void displayMatrix(const int A[][COL]){
    puts("");
    for (int i = 0; i < ROW; i++){
        if (i == 0){
            printf(" %3s  ", " ");
            for (int j = 0; j < COL; j++){
                printf(" %3d ", j);
            }
            puts("");
            printf(" %3s  ", " ");
            for (int j = 0; j < COL; j++){
                printf(" %3s ", "V");
            } 
        }
        for (int j = 0; j < COL; j++){
            if (j % COL == 0){
                puts("");
                printf(" %3d %s", i, ">");  
            }
            printf(" %3d ", A[i][j]);
        } 
    }
    puts("");
}
void displayMatrix ( const int A [ ] [ COL ] ) { puts ( " " ) ; for ( int i = 0 ; i < ROW ; i ++ ) { if ( i == 0 ) { printf ( " " , " " ) ; for ( int j = 0 ; j < COL ; j ++ ) { printf ( " " , j ) ; } puts ( " " ) ; printf ( " " , " " ) ; for ( int j = 0 ; j < COL ; j ++ ) { printf ( " " , " " ) ; } } for ( int j = 0 ; j < COL ; j ++ ) { if ( j % COL == 0 ) { puts ( " " ) ; printf ( " " , i , " " ) ; } printf ( " " , A [ i ] [ j ] ) ; } } puts ( " " ) ; }
displayMatrix: displays the values of matrix
input: the array to be displayed (A)
displayMatrix : displays the values of matrix input : the array to be displayed ( A )
//traverses and displays matrix //prints column header //prints the value of the matrix at the index //prints row header