Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Problem_4_TheSmallestOfThreeNumbers {
- public static void main(String[] args) {
- Scanner scan= new Scanner(System.in);
- System.out.print("a= ");
- double a= scan.nextDouble();
- System.out.print("b= ");
- double b= scan.nextDouble();
- System.out.print("c= ");
- double c= scan.nextDouble();
- double smallestNumber= Math.min(a, b);
- smallestNumber= Math.min(c, smallestNumber);
- System.out.printf("Smallest number of %1$f, %2$f, %3$f is %4$f", a, b, c, smallestNumber);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement