Cognizant interview question

Write two programs. Some profit Loss question