{
m *= 10;
m += n%10;
n /= 10;
}
cout<<"\nRevesed No:"<
Recursive function
int reverse_num(int n,int m){ if(n==0) return m; //base (exit condition) m*=10; m+=n%10; return reverse_num(n/10,m); //recursive call}
No comments:
Post a Comment