Spiral Print 2-D array Test Case-4 Wrong answer

https://hack.codingblocks.com/contests/c/452/440

#include
using namespace std;

void spiralPrint(int a[][100],int m,int n){
int startRow = 0,startCol=0,endRow = m-1,endCol = n-1;

while(startRow<=endRow && startCol<=endCol){
	//Print the start Row 
	for(int i=startCol;i<=endCol;i++){
		cout<<a[startRow][i]<<" ";
	}
	startRow++;

	//Print the end col
	for(int i=startRow;i<=endRow;i++){
		cout<<a[i][endCol]<<" ";
	}
	endCol--;

	//Print the bottom row
	if(endRow>startRow){
		for(int i=endCol;i>=startCol;i--){
			cout<<a[endRow][i]<<" ";
		}
		endRow--;
	}

	//Print the start Col
	if(endCol>startCol){
		for(int i=endRow;i>=startRow;i--){
			cout<<a[i][startCol]<<" ";
		}
		startCol++;
	}
}
return;

}
int main(){

int a[100][100];

int m,n;
cin>>m>>n;
for(int i=0;i<m;i++)
    for(int j=0;j<n;j++)
    cin>>a[i][j];

spiralPrint(a,m,n);

return 0;

}

Send your code after saving in ide of Hacker Blocks as your submission is visible only to you.

You have got answer?
I have modified your code, there were some mistakes on upper bounds:
https://ide.codingblocks.com/#/s/13640