[Updated] Goldman Sachs Aptitude Test Questions and Answers
Practice List of TCS Digital Coding Questions !!!
Take 50+ FREE!! Online Data Interpretation Mock test to crack any Exams.

Program Discussion :: Array

Home > Programs > Array

33 / 30

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: