Advertisement
guillee3

Untitled

Apr 1st, 2020
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. using namespace std;
  2. #include <iostream>
  3. int main()
  4. {
  5. int numero;
  6. bool residuo = false;
  7. cout <<"Introduzca su numero";
  8. cin>>numero;
  9. for(int i=2;i=numero-1;i++)
  10. if (numero%i == 0){
  11. residuo = true;}
  12. else {residuo = false;
  13. }
  14. if (residuo == true){
  15. cout<<"El numero introducido ES primo";
  16.  
  17. }
  18. else {cout<< "El numero introducido NO es par";}
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement