UNA HERMOSA MOTO

UNA HERMOSA MOTO

miércoles, 22 de abril de 2015

Problema Propuesto 12



12.- DEVOLVER EL NUMERO MENOR


Resultado de imagen para NUMERO MENOR

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package propuesto012;
import java.io.*;
/**
 *
 * @author abel montalvan
 */
public class Propuesto012 {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws IOException {
    int n1,n2,m;
 BufferedReader in=new BufferedReader(new  InputStreamReader(System.in));
 System.out.println("Número 1: ");
 n1= Integer.parseInt(in.readLine());
 System.out.println("Número 2: ");
 n2=Integer.parseInt(in.readLine());

 if (n1>n2)
 {

     m=n2;
     }
     else
     {
     m=n1;
     }

 System.out.println("");
 System.out.println("Menor: "+m);

    }
}        
       

No hay comentarios:

Publicar un comentario