Fiest Java
1
public static void main(String[] args) { Scanner leer = new Scanner(System.in); int b=0,i,n; System.out.print("Ingrese un numero: "); n=leer.nextInt(); for(i=1;i<(n+1);i++){ if(n%i==0){ b++; } } if(b!=2){ System.out.println("No es Primo"); }else{ System.out.println("Si es Primo"); } } } CURSO DE PIÑATERÍA Y MANUALIDADES Costo 350,00 Reserva con el 50%
-
Upload
christian-jafet-espinoza-rodriguez -
Category
Documents
-
view
212 -
download
0
description
fiestjava
Transcript of Fiest Java
![Page 1: Fiest Java](https://reader036.fdocuments.us/reader036/viewer/2022081908/5695d1241a28ab9b02954f34/html5/thumbnails/1.jpg)
public static void main(String[] args) {
Scanner leer = new Scanner(System.in);
int b=0,i,n;
System.out.print("Ingrese un numero: ");
n=leer.nextInt();
for(i=1;i<(n+1);i++){
if(n%i==0){
b++;
}
}
if(b!=2){
System.out.println("No es Primo");
}else{
System.out.println("Si es Primo");
}
}
}
CURSO DE PIÑATERÍA Y
MANUALIDADES
Costo 350,00 Reserva con el 50%