jander1
asked on
Write, using a functional programming approach, a function to calculate recursively (using the + operation) any entry in the nine times table.
Write, using a functional programming approach, a function to calculate recursively (using the
+ operation) any entry in the nine times table.
+ operation) any entry in the nine times table.
You are being asked to write a similar function for the 9 row in the multiplication table so if the function is passed any number, it returns 9 times that number using a function like the one above.
Let me know if you need any more help.
Let me know if you need any more help.
ASKER
hi thanks for your responce!
it's not a homework question its just the way i worded it basicly i need a fuctional Recursion for the 9 times table? if you think its homework then can u give me one for like the 8 or 10 times table?
thanks.
it's not a homework question its just the way i worded it basicly i need a fuctional Recursion for the 9 times table? if you think its homework then can u give me one for like the 8 or 10 times table?
thanks.
ASKER
Hi TommySzalapski,
Thank for your reply. can you confirm what the exact function is? this isn't homework
thanks.
Thank for your reply. can you confirm what the exact function is? this isn't homework
thanks.
ASKER
will
int factorial(int n)
{
if( n == 0)
return 1;
else
return n*factorial(n-1)
}
work as the 9 times table?
thanks
int factorial(int n)
{
if( n == 0)
return 1;
else
return n*factorial(n-1)
}
work as the 9 times table?
thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
The other important part is the stop condition (so the function knows when to stop calling itself). Here is a simple example
int factorial(int n)
{
if( n == 0)
return 1;
else
return n*factorial(n-1)
}