C Tutorial
This c program is used to find the profit percentage.
Profit = Sold Amount - Cost Amount Profit Percentage = (Profit * 100/Cost Amount)
#include<stdio.h> void main() { double cost, sold, profit, profit_per; printf("Enter cost amount: "); scanf("%lf", &cost); printf("Enter sold amount: "); scanf("%lf", &sold); profit = sold - cost; profit_per = ((profit *100)/cost); printf("Profit Percentage: %lf\n", profit_per); }Output:
$ cc profit-percentage.c $ ./a.out Enter cost amount: 3000 Enter sold amount: 4000 Profit Percentage: 33.333333
C Tutorial
Privacy Policy | Copyright2020 - All Rights Reserved. | Contact us
| Report website issues in Github
| Facebook page
| Google+ page