IGATE Interview Question

Can you try to make a Magic Square program or an algorithm atleast.