File: test26.ci

package info (click to toggle)
clif 0.90.2-3
  • links: PTS
  • area: main
  • in suites: slink
  • size: 4,336 kB
  • ctags: 2,815
  • sloc: ansic: 29,914; yacc: 4,338; lex: 644; makefile: 373; sh: 48
file content (16 lines) | stat: -rw-r--r-- 208 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
int a, n;
int
fakt (int n)
{
  csuspend;
  if (n == 1)
    return 1;
  else
    return (fakt (n-1) * n);
}
printf ("zadaj n\n");
scanf ("%d", n);
csuspend;
a = fakt (n);
printf ("faktorial = %d\n", a);
exit;