Computer Science, asked by MsAMS, 5 months ago

Draw a flow chart to find biggest and smallest of N given number​

Answers

Answered by samarthkrv
0

Answer:

import java.util.*;

public class Main

{

public static void main(String[] args) {

 Scanner sc = new Scanner(System.in);

 System.out.println("how many numbers are there?");

 int n = sc.nextInt();

 int[] numbers = new int[n];

 System.out.println("Enter all " + n + " numbers-");

     for(int i = 0; i < n; i++){

         numbers[i] = sc.nextInt();

     }

 Arrays.sort(numbers);

 System.out.println("The smallest number is " + numbers[0]);

 System.out.println("The largest number is " + numbers[n-1]);

}

}

Explanation:

Similar questions
Math, 10 months ago