Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main (void){
- int n, f = 1;
- cout << "Ingrese un numero entero positivo para calcular su factorial." <<endl;
- cin >> n;
- for (int i = n ; i > 1 ; i--){
- f = f * i;
- }
- cout << "El factorial de "<< n << " es " << f <<endl;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement