GlobalLogic interview question

Write a program to print spiral matrix?