Cognizant interview question

Basic programming projects puzzles ,java,c