How to find profit and loss in c language