C++ Menghitung Diskon dan Harga

//lh3.googleusercontent.com/-K5UKWzgJhmU/AAAAAAAAAAI/AAAAAAAACdI/CN3nwiBZsGE/s512-c/photo.jpg
November 19, 2016





kita bisa menentukan harga diskon dan harga bersih. silahkan mencoba ya.

 #include <iostream>



using namespace std;



int main()

{

    int hargabarang,disc,hargabersih;



    cout<<"Masukkan Harga Barang : Rp. " ;

    cin>>hargabarang;

    cout<<"Masukkan discount (%) : ";

    cin>>disc;

    cout<<"=============================="<<endl;

    cout<<"Harga Barang : Rp."<<hargabarang<<endl;

    cout<<"Besar Diskon : Rp."<<hargabarang/disc<<endl;

    cout<<"=============================="<<endl;



    hargabersih=hargabarang-(hargabarang/disc);

    cout<<"Harga Bersih : Rp."<<hargabersih<<endl;

    return 0;

}
 


Related Post

SUBSCRIBE TO OUR NEWSLETTER

closed