Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so dont bother with any of their useless mail servers here and just use oauth login instead. Thank the nice Russians for causing that. :)

Paste

Pasted as Java by registered user arbaazssaah ( 6 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: