Cognizant Interview Question

Write program to replace elements of an array