Menu
Question Index
...

Write a program to print the elements in an array. Spaces between numbers are important and all the numbers should be in the same line. Use System.out.println or System.out.print for printing.

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



class PrintElementsInArray
{
    public static void main(String s[])
    {
        int input[] = {4, 6, 19, 2, 7, 12, 1, 9};
        printElementsInArray(input);

    }


    public static void printElementsInArray(int[] input)
    {
    }

}

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