Program to calculate reverse of a number in C++. Solution: #include <iostream> using namespace std; int rev(int n) { static int r=0; if(n==0) return r; else { r=(r*10)+n%10; return rev(n/10);…
C++ ProgramsProgramsRecursive Function
Program to calculate reverse of a number in C++. Solution: #include <iostream> using namespace std; int rev(int n) { static int r=0; if(n==0) return r; else { r=(r*10)+n%10; return rev(n/10);…