Take FREE!! Online Mettl Mock Test to Crack TechM and Other Companies Written Exams.
Get Off-Campus Placement Jobs Info !!!
TCS NQT Technical and Managerial Round Interview Questions

Program Discussion :: Array

Home > Programs > Array

6 / 23

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


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:


Post Your Reply Here: