Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Homework2;
- import java.util.*;
- public class TheSmallestOfThreeNumbers {
- public static void main(String[] args) {
- Scanner sc = new Scanner(System.in);
- System.out.println("Enter a, b, c:");
- double a = sc.nextDouble();
- double b = sc.nextDouble();
- double c = sc.nextDouble();
- double min = a;
- if (b <= min) {
- min = b;
- }
- if (c <= min) {
- min = c;
- }
- System.out.print("The smallest number is " + min);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement