PHP:
class matrisler2 {
public static void main (String args []) throws Exception
{
int mat[][] = new int[4][3];
int i,k,row,col,count;
row=4;
col=3;
count=0;
for(i=0; i<row; i=i+1)
for(k=0; k<col; k=k+1) {
count=count+1;
mat[i][k]=count;
}
for(i=0; i<row i=i+1){
for(k=0; k<col; k=k+1)
System.out.print(mat[i][k] + " ");
System.out.println();
}