Advertisement
saira12tabassum19

Untitled

Jul 9th, 2019
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. //problem no b
  2. #include <stdio.h>
  3.  
  4. int main()
  5. {
  6. int no_students,burger,candy,coke,total;
  7. double discount,amount;
  8. scanf("%d %d %d %d",&no_students,&burger,&candy,&coke);
  9. total=no_students*(burger+candy+coke);
  10. if(total>=5000&&total<=10000)
  11. {
  12. discount=total*.05;
  13. amount=total-discount;
  14. printf("%.2lf\n",amount);
  15. }
  16. else if(total>10000)
  17. {
  18. discount=total*.1;
  19. amount=total-discount;
  20. printf("%.2lf\n",amount);
  21. }
  22. return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement