Advertisement
Guest User

Program Hitung potongan

a guest
Dec 10th, 2016
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.46 KB | None | 0 0
  1. #include <conio.h>
  2. #include <stdio.h>
  3. #include <iostream.h>
  4.  
  5. float potong (int x){
  6. return(
  7.  
  8. if(x>=1000000||x<=5000000){
  9. x*0.20;
  10. if(x<1000000){
  11. x=0;
  12. }}
  13. else if(x>5000000){
  14. x*0.35;});
  15.  
  16. }
  17.  
  18. main()
  19. {
  20.  
  21. float b,t;
  22.  
  23. clrscr();
  24.  
  25. t=b-potong(b);
  26.  
  27. cout<<"Program Hitung Potongan"<<endl;
  28.  
  29. cout<<"Besar Pembelian Barang ";cin>>b;
  30.  
  31.  
  32. cout<<"Besar Potongan yang diberikan "<<potong(b)<<endl;
  33.  
  34.  
  35. cout<<"Besar harga yang harus dibayar "<<t<<endl;
  36. getch();
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement