home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2002 March
/
Chip_2002-03_cd1.bin
/
chplus
/
cecko
/
CPP
/
FAKTORIA.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1998-10-05
|
367b
|
21 lines
// P⌐íklad: Programování v C++ na FJFI - ÇVUT
#pragma hdrfile="TCDEF.SYM" // pro urychlení p⌐ekladu
#include <iostream.h>
unsigned long fak(int n)
{
unsigned long s=1;
int i = 1;
float f = 0;
while (i<=n) {
s = s*i;
i++;
f++;
}
{return s;}
}
int main()
{
cout << "Ahoj\nlidi\nVysledek - faktorial je " << fak(5) << endl;
return 0;
}