Menu
Question Index
...

Write a program to multiply every array element with 3.

Input (Integer Array) Output (Integer Array)
{2, 3, 4, 7, 6, 1} {6, 9, 12, 21, 18, 3}
{3, 9, 1, 5, 16, 10} {9, 27, 3, 15, 48, 30}



class MultiplyEveryArrayElement
{
    public static void main(String s[])
    {
        int[] input = { 3, 5, 6, 7 };
        int[] output = multiplyEveryElement(input);
        System.out.print("Result of multiplying every element by 3 is : ");
        for(int outputElement : output)
        {
            System.out.print(outputElement + ", ");
        }

    }


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

}

Doubts

Problems

Topic: For-each Loop In Core Java Programming

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App