Cognizant interview question

Print every nth number in an array