1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
|
#include <iostream.h>
#include <iomanip.h>
#include <conio.h>
void main ()
{
int a,ergebnis,i=2;
cout<<"Geben Sie eine Zahl ein. Die Fakultaet der Zahl wird berechnet."<<endl<<endl;
cout<<"Zahl: ";
cin >>a;
if (a==0 || a==1)
{
cout<<endl<<a<<"! = 1"<<endl;
}
else
{
for (i==2;i<=a;i++)
{
ergebnis=a*i;
cout<<ergebnis;
}
}
getch();
}
|