Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Mayor{
- public static void main(String[] args){
- int mayor = 0;
- int num = 0;
- int op = 0;
- Scanner objeto = new Scanner(System.in);
- System.out.print("\tEste Programa imprime el mayor de una lista de numeros \n");
- do{
- System.out.print("\n\tTeclea el numero: ");
- num = objeto.nextInt();
- if(num>mayor){
- mayor = num;
- }
- System.out.print("\n\tQuieres Seguir Ingresando Numeros?\n\t 1.-si\t2.-no ");
- op = objeto.nextInt();
- } while ( op == 1);
- System.out.print("\n\tEl numero mayor fue "+mayor+"\n");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement