Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class P05minNumber {
- public static void main (String[]args) {
- Scanner scanner = new Scanner(System.in);
- System.out.print("n = ");
- int n = scanner.nextInt();
- System.out.println("Enter the numbers: ");
- int min = Integer.MAX_VALUE;
- for (int i = 1; i <= n; i++) {
- int num = scanner.nextInt();
- if (num <min) {
- min = num;
- }
- }
- System.out.println("min = " + min);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment