Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- int num;
- int nnum;
- int cnt=1;
- int newn;
- int main()
- {
- cout<<"Enter a number so I can enter its factorial"<<endl;
- cin>>num;
- while(num!=0){
- num=nnum*(num-cnt);
- ++cnt;
- }
- cout<<"The facorial of "<<num<<"is"<<nnum<<endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement