Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
[email protected] webmail now available. Want one? Go here.
Cannot use outlook/hotmail/live here to register as they blocking our mail servers. #microsoftdeez
Obey the Epel!

Paste

Pasted as Java by registered user arbaazssaah ( 4 years ago )
import java.util.Scanner;  
public class TwoDArray {  
public static void main(String[] args) {  
    int[][] arr = new int[3][3];  
    Scanner sc = new Scanner(System.in);  
    for (int i =0;i<3;i++)  
    {  
        for(int j=0;j<3;j++)  
        {  
            System.out.print("Enter Element: ");  
            arr[i][j]=sc.nextInt();  
            System.out.println();  
        }  
    }  
    System.out.println("2D Array: ");  
    for(int i=0;i<3;i++)  
    {   
        System.out.println();  
        for(int j=0;j<3;j++)  
        {  
            System.out.print(arr[i][j]+"\t");  
        }  
    }  
}  
}

 

Revise this Paste

Your Name: Code Language: