#include<cstdlib>
using namespace std;
int main() {
int aux;
int i;
bool temp;
i = 2;
temp = true;
aux = (rand()%100)+1;
while (temp==true) {
aux = (rand()%100)+1;
if (aux%(2)!=0 && aux%(3)!=0 && aux%(5)!=0 && aux%(7)!=0) {
cout << "Si es primo " << aux << endl;
temp = false;
}
}
return 0;
}
No hay comentarios.:
Publicar un comentario