Algoritmo - Factorial de un número en C++

#include <iostream> using namespace std; int main(){ int numero,factorial = 1; cout << "Ingrese el número que desea saber el factorial \n"; cin >> numero; while(numero){ factorial = factorial * numero; numero--; } cout << "El factorial es: " << factorial << endl; }

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.