Write a recursive void function that has one parameter which is a positive integer. When called, the function is to write its argument to the screen backward: If the argument is 1234, the output should be 4321.
Solution
#include <iostream>
using namespace std;
int f(int n);
int main()
{
int number;
cout << "Enter a number: ";
cin >> number;
cout << "The f is: "<< f(number) << endl;
return 0;
}
int f(int n)
{
if ( n == 1)
return 1;
else
return n * (f(n-1));
}الله يسعدكم الي يعرف حل السؤال يساعدني لاني حاولات احل بس مأعرفت

