Matrix search code challenge doubt

sir
when I compile the matrix search code i am getting the correct output but the compiler is displaying the run error
and also it displaying a success status though it is showing run error for all test cases
this is my code

#include
using namespace std;

int stairCaseSearch(int a[100][100],int ele,int rows,int columns){

int r=0;

int c=columns-1;

for(r=0;r<rows;r++){

if(a[r][c]>=ele){
    while(a[r][c]>=ele&&c>=0){
        if(a[r][c]==ele){
            cout<<"1";
            return 1;
        }
        c--;
    }
    c++;
}

}
cout<<“0”;

return 0;

}

int main(){

int a[100][100];

int rows;

int columns;

cin>>rows>>columns;

for(int i=0;i<rows;i++){

for(int j=0;j<columns;j++){

    cin>>a[i][j];
}

}

int ele;

cin>>ele;

stairCaseSearch(a,ele,rows,columns);

return 1;

}

Hey @saisri
Please share your code in IDE

Hey @saisri

this should be return 0;
Main returns1 when its runtime error and 0 when everything went smoothly .
So when u return 1 compiler thinks its runtime error and gives u that verdict

Here add a condition

if(c!=columns-1)c++;

otherwise it can go out of bound