Advertisement
Guest User

Untitled

a guest
May 30th, 2016
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main (void){
  6. int n, f = 1;
  7. cout << "Ingrese un numero entero positivo para calcular su factorial." <<endl;
  8. cin >> n;
  9. for (int i = n ; i > 1 ; i--){
  10. f = f * i;
  11. }
  12. cout << "El factorial de "<< n << " es " << f <<endl;
  13. system("pause");
  14. return 0;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement