Advertisement
DrAungWinHtut

2-gold.c

Mar 2nd, 2023
783
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.55 KB | None | 0 0
  1. #include<stdio.h>
  2. int gold()
  3. {
  4.     float kyat = 0.0;
  5.     float pae = 0.0;
  6.     float yway = 0.0;
  7.     float kyats = 0.0;
  8.     float price_per_kyat = 0.0;
  9.     float total_gold_price = 0.0;
  10.  
  11.     printf("Please enter price_per_kyat value : ");
  12.     scanf_s("%f", &price_per_kyat);
  13.  
  14.     printf("Please enter gold weight (kyat pae yway) : ");
  15.     scanf_s("%f %f %f", &kyat,&pae,&yway);
  16.  
  17.      kyats = kyat + pae/16 + yway /128;
  18.     total_gold_price = price_per_kyat * kyats;
  19.  
  20.     printf("Total gold weights is %f kyats and Total price is %f kyats \n\n", kyats, total_gold_price);
  21.  
  22.     return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement