Get Off-Campus Placement Jobs Info !!!
Programs asked in Mettl Coding Round
Click To Practce List of Programs asked in Nagarro !!!

Program Discussion :: Array

Home > Programs > Array

6 / 23

Write a program to find minimum and maximum of an array?

Answer:

import java.util.*;

public class Maximum_Minimum 
{
    public static void main(String args[])
    {
        int max,min;
        Scanner sc=new Scanner(System.in);
        System.out.println("Enter the size of the array: ");
        int n=sc.nextInt();
        int a[]=new int[n];    //declaring integer array with size n.
        System.out.println("Enter "+n+" numbers: ");
        for(int i=0;i

Asked In :: Virtusa

Post Your Answer Here:

Language:

Post Your Reply Here: