You are on page 1of 1

EJEMPLO DE BUCLE WHILE – ARROJANDO DATOS ALEATORIOS.

public class bucles {


public static void main(String[] args) {
int a = 12;
for (int i =1;i <= a;i += 1) {
System.out.println(i);

}
int count = 0;
System.out.println("/////////////");
while(count<a) {
int b =( int)( Math.random()*7);
if(b!=0) {
System.out.println(b);
count += 1;

}
}

You might also like