kalponikoronno

crr

Mar 25th, 2015
277
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.08 KB | None | 0 0
  1.     #include <stdio.h>
  2.  
  3.  
  4.     int main() {
  5.  
  6.  
  7.     float codersprice_1 = 0, codersprice_2 = 0, codersquantity_1 = 0, codersquantity_2 = 0,
  8.     total_1 = 0,
  9.     total_2 = 0,
  10.     tax = 0,
  11.     full_amount = 0,
  12.     cash_offering = 0,
  13.     change = 0;
  14.  
  15.  
  16.  
  17.     printf("quantity of codersquantity_1\n");
  18.     scanf("%f", &codersquantity_1);
  19.     printf("price of codersprice_1\n");
  20.     scanf("%f", &codersprice_1);
  21.  
  22.  
  23.     printf("quantity of codersquantity_2\n");
  24.     scanf("%f", &codersquantity_2);
  25.     printf("price of codersprice_2\n");
  26.     scanf("%f", &codersprice_2);
  27.  
  28.  
  29.  
  30.  
  31.     total_1 = codersprice_1 * codersquantity_1;
  32.     total_2 = codersprice_2 * codersquantity_2;
  33.     tax = 0.07*(total_1 + total_2);
  34.     full_amount= total_1 + total_2 + tax;
  35.     change = cash_offering - full_amount;
  36.  
  37.  
  38.  
  39.     printf("Your total is: %.2f\n", full_amount);
  40.  
  41.  
  42.  
  43.     printf("Enter Changing money\n");
  44.     int cm;
  45.     scanf("%d", &cm);
  46.     int b;
  47.     b = cm;
  48.  
  49.     float a;
  50.     a= full_amount;
  51.  
  52.  
  53.     printf ("Here is your change %.2f\n", cm-a);
  54.  
  55.  
  56.  
  57.  
  58.     return 0;
  59.     }
Advertisement
Add Comment
Please, Sign In to add comment