Sei sulla pagina 1di 1

/*

* To change this license header, choose License Headers in Project Properties.


* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package marzo19;
import javax.swing.JOptionPane;
/**
*
* @author Pregrado
*/
public class Marzo19 {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
int a,i=1;
String texto1;
texto1=JOptionPane.showInputDialog("Ingrese un numero entero,minimo 2 o max
imo 4");
a=Integer.valueOf(texto1);
JOptionPane.showMessageDialog(null,"el numero digitado es: "+a);
for (; i < a+1; i++) {
double x= Math.random();
int j=0;
JOptionPane.showMessageDialog(null,"se genero en la posicion "+i+" e
l numero "+x);
if (i==j) {
}
else if((i-1)>i && i-1!=0)
{
JOptionPane.showMessageDialog(null,"entonces "+(i-1)+" es may
or a "+i);
}
else if( (i-1)< i && i-1!=0){
JOptionPane.showMessageDialog(null,"entonces "+(i)+" es mayor a
"+(i-1));
}
}
}
}

Potrebbero piacerti anche