From 419fe767cec1ce96113d9486c857404955460891 Mon Sep 17 00:00:00 2001 From: satyam singh Date: Thu, 14 Oct 2021 20:44:22 +0530 Subject: [PATCH] initial commit --- C/program-83/program.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 C/program-83/program.c diff --git a/C/program-83/program.c b/C/program-83/program.c new file mode 100644 index 00000000..a8c5759b --- /dev/null +++ b/C/program-83/program.c @@ -0,0 +1,29 @@ +/*program to calculate profit & loss in BITCOIN mining*/ + +#include + +int main(){ + + float current_btc_price, avg_cost; + float total_btc, profitloss; + + printf("Enter Your Total Bitcoin: "); + scanf("%f",&total_btc); + + printf("Enter Current Bitcoin Price: "); + scanf("%f",¤t_btc_price); + + printf("Your Average Bitcoin Purchase Price: "); + scanf("%f",&avg_cost); + + //profitloss = (current_btc_price - averagecost) x total_btc + + profitloss = (current_btc_price - avg_cost) * total_btc; + + if(profitloss > 0) + printf("Bitcoin Trading Profit is: %0.2f",profitloss); + else + printf("Bitcoin Trading Loss is: %0.2f",profitloss); + + return 0; +} \ No newline at end of file