#include <stdio.h> #define fac(n,sum) while(n>1) { --n;sum *=n; } int main (void) { int n,sum; scanf("%i",&n); sum=n; fac(n,sum); printf("%i\n",sum); return 0; }
#include <stdio.h> #define fac(n, product) \ while(n > 1) { \ product *= n--; \ } int main(void) { int n, product = 1; scanf("%d", &n); fac(n, product ); printf("product : %d\n", product); return 0; }