Untitled

 avatar
unknown
plain_text
4 months ago
584 B
7
Indexable
package program;

import java.util.Scanner;

     public class TwoD {
     public static void main(String []args) {
		
		int a[][]=new int[3][3];
		
		
		Scanner sc=new Scanner(System.in);
		
		System.out.print("Enter the Array elements : ");
		
		for(int i = 0 ; i< 3; i++) {
			for(int j=0 ; j< 3 ; j++ ) {
				a[i][j]=sc.nextInt();
			}
		}

		System.out.println("Array elements Are :");
		for(int[] x : a) {
			for(int s : x) {
				System.out.print(" "+s);
			}
			
			System.out.println();
			
		}
		
		sc.close();
     
     
     
     }
 }
Editor is loading...
Leave a Comment