Advertisement
valve2

// this program calc's com of ".10"

Jan 20th, 2023 (edited)
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.51 KB | None | 0 0
  1. // this program calc's com of ".10" using a while loop
  2. #include <stdio.h>
  3. int main(void) {
  4.     float commission_rate = .10, sales;
  5.     float commission;
  6.     int keepgoing = 1;
  7.  
  8.  
  9.  
  10.     while (keepgoing == 1) {
  11.         printf("Enter sales\n");
  12.         scanf_s("%f", &sales);
  13.         commission = sales * commission_rate;
  14.         printf("Your commission is = $");
  15.         printf("%f%\n", commission);
  16.         printf("Enter 1 if you want to calculate a other commission, Enter 0 if you want to end\n\n");
  17.         scanf_s("%d", &keepgoing);
  18.     }
  19.     return 0;
  20. }
  21.  
  22.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement