Advertisement
TheVideoVolcano

Java number sort (w.i.p) - (for manmohan)

Feb 8th, 2018
316
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.76 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class numberSort {
  4.     public static void main(String args[]) {
  5.         Scanner scanner = new Scanner(System.in);
  6.  
  7.  
  8.         int m, y, k;
  9.         System.out.print("Enter First Number: ");
  10.         m = scanner.nextInt();
  11.         System.out.print("Enter Second Number: ");
  12.         y = scanner.nextInt();
  13.         System.out.print("Enter Third Number: ");
  14.         k = scanner.nextInt();
  15.  
  16.         // m = 57;
  17.         // y = 46;
  18.         // k = 100;
  19.  
  20.         int j = 0;
  21.  
  22.         if ((m > y) && (m > k)) {
  23.             j = m;
  24.         }else if ((y > m) && (y > k)) {
  25.  
  26.                 j = y;
  27.  
  28.             } else {
  29.  
  30.                 j = k;
  31.             }
  32.            
  33.         System.out.println("Largest: " + j);
  34.         }
  35.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement