latest Post

Contoh program perhitungan pembelanjaan dengan C++

Berikut contoh program perhitungan pembelanjaan dengan menggunakan Dev-C++

#include <iostream>
using namespace std;
int main ()
{
 int a,b,c,d;
 cout<<"Harga Barang \t: ";
 cin>>a;
 cout<<"Jumlah Barang \t: ";
 cin>>b;
 
 
 cout<<"Harga Beli \t: "<<a*b;
 
 if (b>100)
 {
 cout <<"\nDiscount 15% \t: "<<c*15/100;

 }
 
 else
 {
 cout <<"\nDiscount 5% \t: "<<c*5/100;
 }
 
 cout<<"Total Bayar \t: ";cout<<c-d;

 
 
 return 0;
} 

About Unknown

Unknown
Recommended Posts × +

0 comments:

Post a Comment