Find smallest and largest number in array in java
Answers
Answered by
0
smallest and largest number of array java..
plz mark brainliest anss......
plz mark brainliest anss......
Attachments:
Answered by
1
import java.util.Arrays;
public class LargestSmallestNumber {
public static void main(String[ ] args) {
int[ ] numbers = {12, 34, 35, 47, 46, 43, 6, 34, 5, 45, 3, 49, 80, 56};
Arrays.sort(numbers);
System.out.printf("Smallest number - %d%nLargest numbers - %d",
numbers[0], numbers[numbers.length - 1]);
}
}
Similar questions