Cognizant Interview Question

Please write an algoritm for building a spiral matrix using a 2D array in C.