Skip to content

Instantly share code, notes, and snippets.

@johnaiker
Created June 29, 2022 16:44
Show Gist options
  • Save johnaiker/738a4d009c2d70a04c48e9e12d1ba7cd to your computer and use it in GitHub Desktop.
Save johnaiker/738a4d009c2d70a04c48e9e12d1ba7cd to your computer and use it in GitHub Desktop.
#include <iostream>
using namespace std;
int main() {
float numero1, numero2, multiplo, opcion;
int i;
do {
cout << "Inserte el primer numero: ";
cin >> numero1;
cout << endl << "Ahora inserte el segundo: ";
cin >> numero2; cout << endl;
cout << "- Los multiplos de " << numero1 << " menores que " << numero2 << " son: ";
for (i = 1; i <= numero2; i++) {
multiplo = numero1 * i;
if (multiplo >= numero2) {
break;
}
cout << endl << "- " << multiplo;
}
cout << endl << "Para ejecutar de nuevo inserte '1', sino escriba '0' " << endl; cin >> opcion;
system("cls");
} while (opcion == 1);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment