fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. // your code goes here
  6. int n;
  7. cout<<"enter the number";
  8. cin>>n;
  9. int fact=1;
  10. for(int i=5;i>0;i--){
  11. fact=fact*i;
  12. }
  13. cout<<fact;
  14. return 0;
  15. }
  16.  
Success #stdin #stdout 0.01s 5288KB
stdin
5
stdout
enter the number120