asheykh,
change this
cin>>a[2][2];
to
cin>>a[i][j];
so that it fills the matrix correctly, instead of placing the number always into position [2][2]
I would recommend using variable names like RowCtr & ColCtr intead of i,j . It's easier to understand and will save you one day.
HTH
asheykh,
It would better to put the input from cin into it's own variable so you can check for valid input first before putting it into the array.