Advertisement
mmayoub

Ex07, 01.05.2021

May 4th, 2021
804
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.61 KB | None | 0 0
  1. // 01.05.2021
  2. import java.util.Scanner;
  3.  
  4. public class Ex07 {
  5.  
  6.     public static void main(String[] args) {
  7.         // TODO Auto-generated method stub
  8.         // 5, 7 , 12 --> 12
  9.         // 8, 4, 6 --> 8
  10.         int a, b, c;
  11.  
  12.         Scanner in = new Scanner(System.in);
  13.         System.out.print("Enter three numbers: ");
  14.         a = in.nextInt();
  15.         b = in.nextInt();
  16.         c = in.nextInt();
  17.  
  18.         if (a > c && a > b) {
  19.             System.out.println("the great number is " + a);
  20.         } else {
  21.             if (b > c && b > a) {
  22.                 System.out.println("the great number is " + b);
  23.             } else {
  24.                 System.out.println("the great number is " + c);
  25.             }
  26.         }
  27.         in.close();
  28.     }
  29.  
  30. }
  31.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement