#include <stdio.h>

unsigned loop_fact(int n);
unsigned recusion_fact(int n);


int 
main()
{
	int a = 10;
	printf("recursion: %u\n",recusion_fact(a));
	printf("loop: %u\n",loop_fact(a));
	return 0; 
}

unsigned
recusion_fact(int n)
{
	unsigned fact = 1;
	if (n == 1)
		return fact;
	else
		return n*recusion_fact(n-1);
}

unsigned
loop_fact(int n)
{
	unsigned fact = 1;
	for (int i = 1; i <= n; i++)
		fact*=i;
	return fact;
}
