Advertisement
Guest User

Untitled

a guest
Feb 26th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. #include<iostream>
  2.  
  3. using namespace std;
  4.  
  5. int num;
  6. int nnum;
  7. int cnt=1;
  8. int newn;
  9.  
  10. int main()
  11. {
  12. cout<<"Enter a number so I can enter its factorial"<<endl;
  13. cin>>num;
  14. while(num!=0){
  15. num=nnum*(num-cnt);
  16. ++cnt;
  17. }
  18. cout<<"The facorial of "<<num<<"is"<<nnum<<endl;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement