1.

Write a program to display 4×5array​

Answer»

Answer:

JAVA

public class PrintArray {

public static void main(String[] args) {

//Initialize array.

int [] arr = new int [] {1, 2, 3, 4, 5};

System.out.println("ELEMENTS of given array: ");

//LOOP through the array by incrementing value of i.

for (int i = 0; i < arr.length; i++) {

System.out.print(arr[i] + " ");

Explanation:

@Ask The MASTER



Discussion

No Comment Found