Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class eje4 {
- public static void main(String[] args){
- Scanner S = new Scanner(System.in);
- int a,b,c;
- String r;
- do{
- System.out.println("Ingrese el primer numero:");
- a = S.nextInt();
- System.out.println("Ingrese el segundo numero:");
- b = S.nextInt();
- System.out.println("Ingrese el tercer numero");
- c = S.nextInt();
- if (a<b && b<c){
- System.out.println("los numeros estan ordenados en orden ascendente");
- }
- else{
- if (a>b && b>c){
- System.out.println("los numeros estan ordenados en orden descendente");
- }
- else{
- if (a==b && b==c){
- System.out.println("los numeros son iguales");
- }
- else{
- System.out.println("los numeros estan desordenados");
- }
- }
- }
- System.out.println("DESEA SALIR(s/n)");
- r = S.next();
- }while(!r.equals("n"));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement