Question 7
import java.util.Scanner;
class Question7
{
    public static void main()
    {
        Scanner scn =  new Scanner(System.in);
        int arr[] = new int[20];
        int sum=0;
        System.out.println("Enter 20 integer elements : ");
        for(int i=0;i < 20;i++)
        {
            System.out.print("Enter "+(i+1)+" element : ");
            arr[i]=scn.nextInt();
            sum+=arr[i];
        }
        int max=arr[0],min=arr[0];
        for(int i=1;i < 20;i++)
        {
            if(arr[i] > max)
            max=arr[i];
            if(arr[i] < min)
            min=arr[i];
        }
        System.out.println("The largest number from the array : "+max);
        System.out.println("The smallest number from the array : "+min);
        System.out.println("The sum of allthe elements of the array : "+sum);
    }
}