Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <conio.h>
- #include <stdio.h>
- #include <iostream.h>
- float potong (int x){
- return(
- if(x>=1000000||x<=5000000){
- x*0.20;
- if(x<1000000){
- x=0;
- }}
- else if(x>5000000){
- x*0.35;});
- }
- main()
- {
- float b,t;
- clrscr();
- t=b-potong(b);
- cout<<"Program Hitung Potongan"<<endl;
- cout<<"Besar Pembelian Barang ";cin>>b;
- cout<<"Besar Potongan yang diberikan "<<potong(b)<<endl;
- cout<<"Besar harga yang harus dibayar "<<t<<endl;
- getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement