No loop

Without if, if…else, ?:, for, while, do…while, goto to solve Factorial

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/*************************************************************************
> File Name: noloop.c
> Author: _IDLER_
> Website: http://idler1229.top
************************************************************************/


#include <stdio.h>
#define LL long long

LL Factorial(LL n)
{

LL part = 1;
n && (part = n * Factorial(n-1));
return part;
}

void test()
{

for (LL i = 0; i < 10; i++)
printf("%lld\n", Factorial(i));
}

int main ()
{

test();
return 0;
}
Contents
  1. 1. Without if, if…else, ?:, for, while, do…while, goto to solve Factorial