Advertisement
cesarnascimento

números em ordem ex 3 int comp

May 7th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.49 KB | None | 0 0
  1. package ex2;
  2. import java.util.Scanner;
  3. public class ex2 {
  4.  
  5.     public static void main(String[] args) {
  6.         Scanner sc = new Scanner(System.in);
  7.         System.out.println("Digite o primeiro número");
  8.         int um = sc.nextInt();
  9.         System.out.println("Digite o segundo número: ");
  10.         int dois = sc.nextInt();
  11.        
  12.         if( um > dois){
  13.             System.out.println("Os números em ordem são: "+dois+" e "+um);
  14.         }
  15.         else if(dois > um){
  16.             System.out.println("Os números em ordem são: "+um+" e "+dois);
  17.         }
  18.     }
  19.  
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement