File: faktor.ci

package info (click to toggle)
clif 0.93-8
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, lenny
  • size: 3,616 kB
  • ctags: 2,881
  • sloc: ansic: 31,464; yacc: 5,067; lex: 819; makefile: 389; sh: 48
file content (15 lines) | stat: -rw-r--r-- 188 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
int a, n;
int 
fakt (int n)
{
  if (n == 1)
    return 1;
  else
    return (fakt (n-1) * n);
}

printf ("zadaj n\n");
scanf ("%d", n);
a = fakt (n);
printf ("faktorial = %d\n", a);
exit;