Menu
Question Index
...

Write a program to reverse the input array.

Input (Integer Array) Output (Integer Array)
{2, 3, 4, 7, 6, 1} {1, 6, 7, 4, 3, 2}
{3, 9, 1, 5, 16, 10} {10, 16, 5, 1, 9, 3}



class ReverseOfArray
{
    public static void main(String s[])
    {
        int[] input = {2, 6, 3, 8, 1};
        int[] output = reverseOfArray(input);
        System.out.print("Reverse of the array is : " );
        for(int outputElement : output)
        {
            System.out.print(outputElement + ", ");
        }

    }


    public static int[] reverseOfArray(int[] input)
    {
        int[] output = null;
        return output;
    }

}

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