Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Exc1SmallestNumber {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int a = Integer.parseInt(scanner.nextLine());
- int b = Integer.parseInt(scanner.nextLine());
- int c = Integer.parseInt(scanner.nextLine());
- System.out.println(getSmallestNumber(a,b,c));
- }
- private static int getSmallestNumber(int a, int b, int c) {
- return getSmallestNumber(getSmallestNumber(a,b),c);
- }
- private static int getSmallestNumber(int a, int b) {
- if (a<b){
- return a;
- }
- return b;
- }
- }
- //Write a method to print the smallest of three integer numbers. Use appropriate name for the method.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement