int storeOccurence(int *a,int n,int key,int i,int *out,int j){
if(i==n){
return j;
}
else if(a[i]==key){
out[j]=i;
storeOccurence(a,n,key,i+1,out,j+1);
}
else{
storeOccurence(a,n,key,i+1,out,j);
}
}
is code me dikkat hai ye abhi bhi previous vali non-control of non-void type function dikha rha hai
Regarding compile type erroe problem
@praveeng1234 return type is int so you have return something int the end also while function calling store that val or return.
or dont return anything and make the return type void