Cognizant interview question

Write a program to print duplicate words from array?