view test/fact0.c @ 0:d35df41eac69

Initial revision
author kono
date Thu, 13 Jan 2000 02:41:41 +0900
parents
children fdbf2fbc8140
line wrap: on
line source

#include "stdio.h"

main(ac,av)
int ac;
char *av[];
{
    printf("%d\n",fact(1,1,atoi(av[1])));
}

int
fact(i,j,n) 
/*register*/ int i,j,n;
{
    if (i==n)
	return j;
    fact(i+1,j*i,n);
}