0% found this document useful (0 votes)
4 views1 page

Practical5 1JPR

The document provides a practical exercise to demonstrate the use of arrays and vectors in programming. It includes a Java program that implements a multidimensional array and prints its elements in a formatted manner. The output of the program displays a 3x3 grid of numbers from 1 to 9.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views1 page

Practical5 1JPR

The document provides a practical exercise to demonstrate the use of arrays and vectors in programming. It includes a Java program that implements a multidimensional array and prints its elements in a formatted manner. The output of the program displays a 3x3 grid of numbers from 1 to 9.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Practical-No: 5

*Write programs to demonstrate: Use of Array. Use of Vectors.


PRQ-1: Write a program to implement multidimensional array.
Code:
class MultiDArray {
public static void main(String args[]) {
int[][] array = {
{1, 2, 3},
{4, 5, 6},
{7, 8, 9}
};
for (int i = 0; i < array.length; i++) {
for (int j = 0; j < array[i].length; j++) {
System.out.print(array[i][j] + " ");
}
System.out.println();
}
}
}

Output:

You might also like