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);…
Program to find the sum of digits of a number using recursion in C++. Solution #include <iostream> using namespace std; int sumdigit(int n) { if (n == 0) return 0;…
Program to count the digits of a given number using recursion in C++. Solution : #include <iostream> using namespace std; int CountD(int n) { static int count=0; if (n >…