
an application that finds the smallest of several integers. assume the first value read specifies the number of values to input from the user. please help!!!

import java.util.*;
class NumberApplication{
public static void main(String[] args)
{
Scanner input=new Scanner(System.in);
System.out.print("How many numbers you want to enter: ");
int num=input.nextInt();
int numbers[] = new int[num];
for(int i=0; i < numbers.length; i++){
numbers[i]=input.nextInt();
}
int smallest = numbers[0];
for(int i=1;i<numbers.length;i++){
if(numbers[i] < smallest){
smallest = numbers[i];
}
}
System.out.print("Smallest Number: "+ smallest);
}
}
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.