Advertisement
Farjana_akter

Untitled

Mar 23rd, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. long long int fac[30];
  4. void fact()
  5. {
  6. fac[0]=1;
  7. for(int i=1;i<=20;i++)
  8. fac[i]=fac[i-1]*i;
  9. }
  10. int main()
  11. {
  12. fact();
  13. long long int n,i,j;
  14. while(cin>>n)
  15. {
  16. if(n<7 && n>0 )
  17. cout<<"Underflow!"<<endl;
  18. else if(n>13)
  19. cout<<"Overflow!"<<endl;
  20. else
  21. cout<<fac[n]<<endl;
  22. }
  23. return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement