Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // this program calc's com of ".10" using a while loop
- #include <stdio.h>
- int main(void) {
- float commission_rate = .10, sales;
- float commission;
- int keepgoing = 1;
- while (keepgoing == 1) {
- printf("Enter sales\n");
- scanf_s("%f", &sales);
- commission = sales * commission_rate;
- printf("Your commission is = $");
- printf("%f%\n", commission);
- printf("Enter 1 if you want to calculate a other commission, Enter 0 if you want to end\n\n");
- scanf_s("%d", &keepgoing);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement