the following simple program takes in values of cost price and selling price from the user and tells whether the user profited or lost, and by how much:
#include