Expand|Select|Wrap|Line Numbers

- #include<iostream.h>
- #include<string>
- using namespace std;
- int main(void){
- int fac;
- int n;
- string b;
- cout<<"this program produces the factorial of a number"<<"/n";
- cout<<"type an integer"<<"/n";
- cin>>n;
- if(n>0){
- int c=1;
- for(int a;n>=0;n=n-1){
- a=n-1;
- b=a*n;
- c=b*c;
- }
- cout<<c;}
- cin>>b;
- }