Java Lab: Smallest Number

preview_player
Показать описание
----------------------------------------------------------------------------------------
Social media:
----------------------------------------------------------------------------------------

Code in comments
Рекомендации по теме
Комментарии
Автор

import java.util.Scanner;

public class SmallestNumber {
public static void main(String[] args) {
Scanner scnr = new Scanner(System.in);

int num1 = scnr.nextInt();
int num2 = scnr.nextInt();
int num3 = scnr.nextInt();

int smallest;

if ((num1 < num2) && (num1 < num3)) {
smallest = num1;
}

else if ((num2 <= num1) && (num2 <= num3)) {
smallest = num2;
}

else {
smallest = num3;
}



scnr.close();
}
}

collegehelper