Advertisement
M_Andreev

TheSmallestNumber

Sep 7th, 2014
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.49 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class _04_TheSmallestNumber {
  4.  
  5.     public static void main(String[] args) {
  6.         Scanner sc = new Scanner(System.in);
  7.         System.out.print("First number: ");
  8.         double num1 = sc.nextDouble();
  9.        
  10.         System.out.print("Second number: ");
  11.         double num2 = sc.nextDouble();
  12.        
  13.         System.out.print("Third number: ");
  14.         double num3 = sc.nextDouble();
  15.        
  16.         double smallest = Math.min(num1, Math.min(num2, num3));
  17.        
  18.         System.out.print("Smallest: " + smallest);
  19.     }
  20.  
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement