Pregunta de entrevista de Cognizant

Write two programs. Some profit Loss question