Matrix print with a given input n

I need to print matrix with given input n and matrix should look like for n=2
1 2
4 3
please help me with a logic and loop conditions