Test cases are failing

#include
using namespace std;

int replaced0with5(int N){
int rev=0,reva=0,r;
while(N>0){
r=N%10;
if(r==0){
r=5;
}
rev = rev*10+r;
N=N/10;
}

while(rev>0){
	r=rev%10;
	reva=reva*10+r;
	rev=rev/10;
}
return reva;

}

int main() {
int hN;
cin>>hN;
cout<<replaced0with5(hN);
return 0;
}

hi @pushkarsingh5247_4b1a78f1d102c737,

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.