I found an interview question which requires us to print the elements of the matrix in a spiral order starting from the top left. I need some pointers on how to improve my code:#include <stdio.h>//function that prints a row from startx,starty to endyvoid printRow(int arr[][4],int startx,int starty,int endy){    int yCtr;    for(yCtr = starty; yCtr <= endy ; yCtr ++)       printf(%d ,arr[startx][yCtr]);}//function that prints a row from startx,starty to endy (decreasing columns)void printRowBackward(int arr[][4],int startx,int starty,int endy){    int yCtr;    for(yCtr = starty; yCtr >= endy ; yCtr --)       printf(%d ,arr[startx][yCtr]);}//function that prints a column from startx,starty to endxvoid printColumnBackward(int arr[][4],int startx,int starty,int endx){   int xCtr;    for(xCtr = startx; xCtr >= endx; xCtr --)       printf(%d ,arr[xCtr][starty]);}// column backwardsvoid printColumn(int arr[][4],int startx,int starty,int endx){    int xCtr;    for(xCtr = startx; xCtr <= endx; xCtr ++)       printf( %d ,arr[xCtr][starty]);}// prints a section of the spiralvoid printSpiralSection(int arr[][4],int startx,int starty,int size){   printRow(arr,startx,starty,size - 1);   printColumn(arr,startx + 1 ,size - 1 ,size -1);   printRowBackward(arr,size - 1,size - 2,starty);   printColumnBackward(arr,size - 2,starty,startx + 1);}int main(){    int array[4][4] = { 22 ,323,2342,222,                          2,234,243,333,                          21,13,23,444,                          223,234,231,234};    int startx =0, starty = 0, size = 4;    // prints each section of the spiral ...     while(size >=1) {       printSpiralSection(array,startx,starty,size);       size --;       startx++;       starty++;    }    getchar();    return 0;}
Program to display a matrix in a spiral form
c;interview questions;matrix