Is there any problem in this code?

#include
using namespace std;
void exchange ( long long int N){
long long int newno = 0, count = 1;
while( N > 0 ){
int digit = N% 10;
if( digit == 0){
digit = 5;
}
newno += digit * count;
count *= 10;
N = N/10;
}
cout << newno;
}
int main() {
long long int n;
cin >>n;
exchange(n);
return 0;
}

hi @akki56756_bab14f919dbad123
just add a base case that if n is 0, then return 5…
corrected code -->

hi @akki56756_bab14f919dbad123
i hope it’s clear now??

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.