mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-17 08:49:31 -06:00
22 lines
229 B
C
22 lines
229 B
C
int fact (int n) {
|
|
int f ;
|
|
f = 1 ;
|
|
{
|
|
while (1 < n) {
|
|
f = n * f ;
|
|
n = n - 1 ;
|
|
}
|
|
}
|
|
return f ;
|
|
} ;
|
|
|
|
int main () {
|
|
int n ;
|
|
n = 1 ;
|
|
{
|
|
while (n < 11) printf("%d",fact(n)) ; n = n+1 ;
|
|
}
|
|
return ;
|
|
} ;
|
|
|