Menu
Question Index
...


Write a program to get the common maximum number between two arrays.
It returns -999, when there is no common number

Input(First Array, Second Array) Output
{12, 76, 101, 99}, {99, 23, 12, 97} 99
{-99, -3, -98, -50, -1000}, {-50, -3, -98, -99} -3
{64, 73, 19, 10, 125, 199}, {1, 7, 125, 19} 125
{2, 4, 6, 12, 18}, {3, 5, 9, 21, 23, 25} -999

class CommonMaximumNumber

{    public static void main(String s[])
    {
        int firstArray[] = {2, 55, 20, 89, 7, 4};
        int secondArray[] = {95, 23, 2, 7, 55, 17};
        int number = getCommonMaximumNumber(firstArray, secondArray);
        System.out.println("The number is " + number);

    }


public static int getCommonMaximumNumber(int firstSeries[], int secondSeries[])
{
//Write code here to get the common maximum number and return it.
}
}

Doubts

Problems

Topic: Learn Arrays And Loops

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App