Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.34 KB | None | 0 0
  1. public static void main(String[] args) {
  2.  
  3.         Scanner scan = new Scanner(System.in);
  4.  
  5.       System.out.print("Mata in två heltal: ");
  6.  
  7.       int tal1 = scan.nextInt();
  8.  
  9.       int tal2 = scan.nextInt();
  10.  
  11.       int max = tal1 > tal2 ? tal1 : tal2;
  12.  
  13.       System.out.println("Det största talet är " + max);
  14.  
  15.     }
  16.  
  17.    
  18.  
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement