Menu
Question Index
...

Write a program to find modulus every array element with 7.

Input (Integer Array) Output (Integer Array)
{2, 14, 8, 42, 15} {2, 0, 1, 0, 1}
{21, 34, 3, 8, 16} {0, 6, 3, 1, 2}



class ModulesEveryArrayElement
{
    public static void main(String s[])
    {
        int[] input = { 3, 15, 16, 7 };
        int[] output = getModulusOfEveryArrayElement(input);
        System.out.print("Modulus of every element is : ");
        for(int element : output)
        {
            System.out.print(element + ", ");
        }

    }


    public static int[] getModulusOfEveryArrayElement(int[] input)
    {
        int[] result = null;
        return result;
    }

}

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