$ ./a.out
Enter size of magic square: 3
8 1 6
3 5 7
4 9 2


Perhaps remove the \n from the first printf ?