I'm not very good at recursion - how would I write a program to show compound interest of 1%/month over 12 months?
I'm supposed to convert this factorial example:
Code:#include<stdio.h>
int factorial(long);
int main(void)
{
int i;
for (i=1; i<=10; i++)
printf("%2d! = %ld\n", i, factorial(i));
return (0);
}
int facotial(long num)
{
if (number <= 1)
return (1);
else
return (number * factorial(number -1));
}