more examples

This commit is contained in:
aarne
2004-09-25 08:51:33 +00:00
parent 5a208ce3ea
commit a6219b3a09
3 changed files with 30 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
int fact (int n) {
int f ;
f = 1 ;
while (1 < n) {
f = n * f ;
n = n - 1 ;
}
return f ;
} ;

Binary file not shown.

After

Width:  |  Height:  |  Size: 132 KiB

View File

@@ -0,0 +1,21 @@
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(int,fact(n)) ; n = n+1 ;
}
return ;
} ;