You are on page 1of 1

programa23.

java

1 import java.util.Scanner;
2 public class programa23 {
3 public static void main(String[] args) {
4 Scanner sc=new Scanner(System.in);
5 int X;
6 System.out.println("Ingresa un numero ");
7 int A = sc.nextInt();
8 System.out.println("Ingresa un numero ");
9 int B = sc.nextInt();
10 System.out.println("Ingresa un numero ");
11 int C = sc.nextInt();
12 System.out.println("Ingresa un numero ");
13 int D = sc.nextInt();
14 if(A == B && A == C && A == D){
15 System.out.println("ingrese numeros diferentes");
16 }
17 if(A > B && A > C && A > D){
18 X=A;
19 }else{
20 if(B > A && B > C && B > D){
21 X=B;
22 }else{
23 if(C > A && C > B && C > D){
24 X=C;
25 }else
26 X=D;{
27 System.out.println("el mayor es "+X);
28
29 }}}}}

Page 1

You might also like