Pls help me with this its showing fatal error

#include<bits/stdc++.h>
using namespace std;

void printing(int *a,int n,int key, int i){
if(i==n){
return;
}

if(a[i]==key){
    cout<<i<<" ";
}

printing(a,n,key,i+1);

}

int main(){

int a[]={1,2,0,1,3,9,1,40};
printing(a,8,1,0);

return 0;

}

hi @anshul3558_e8c9aa486c392ca3 the code is running fine