Ejercicios Java

download Ejercicios Java

of 3

Transcript of Ejercicios Java

Seintroduceunacantidadde5nmerosdeloscualeselusuariodeseaqueseimprimanenformadescendente.package EXAMEN;import javax.swing.*;public class PREGUNTA_1 {

public static void main(String[]args) { double a,b,c,Mayor=0,Medio=0,Menor=0; String guardarTem; //PIDIENDO NUMEROS guardarTem=JOptionPane.showInputDialog("Dame un numero"); a=Double.parseDouble(guardarTem); guardarTem=JOptionPane.showInputDialog("Dame un numero"); b=Double.parseDouble(guardarTem); guardarTem=JOptionPane.showInputDialog("Dame un numero"); c=Double.parseDouble(guardarTem);//---------------------->Condiciones...//MAYORif( (a>b) && (a > c ) )Mayor=a;else if( (b>a) && ( b > c ) )Mayor=b;else if( (c>a) && (c> b ) )Mayor=c;//MENORif( (a