How to take input in matrix form?

i could not understand how to take input in matrix form.

hello @naveenkumpatla
int a[m][n]
for(int i=0;i<m;i++ ){
for(int j=0;j<n;j++){
cin>>a[i][j];
}
}
in this way you can take the input in the matrix.
if you still have doubt you can reply here .
Happy Learning !!

in java how to take it?

i mean in question it is mentioned row wise input in input format.

for(int i =0 ; i<n;i++)
{
	for(int j=0;j<m;j++)
	{
		arr[i][j] = sc.nextInt();
	}
}

use this