#include <stdio.h>
int sum_iter(int n)
{
int i,sum=0;
for(i=1;i<=n; i++)
sum += i;
return sum;
}
int sum_rc(int n)
{
if(n == 1)
return 1;
else
return n+sum_rc(n-1);
}
int main(void)
{
int result;
result = sum_iter(10);
printf("sum_iter(10) = %d \n",result);
result = sum_rc(10);
printf("sum_rc(10) = %d \n",result);
}