#include <stdio.h>
#include <conio.h>
void main()
{
char Nama_Barang;
int Banyak_Barang, Harga_Satuan;
float Total_Harga, Discount, Total_Bayar;
printf("Nama Barang=");scanf("%s",&Nama_Barang);
printf("Harga Satuan=");scanf("%d",&Harga_Satuan);
printf("Banyak Barang=");scanf("%d",&Banyak_Barang);
Total_Harga=Harga_Satuan*Banyak_Barang;
Discount=10*Total_Harga/100; //10% di kali total harga
Total_Bayar=Total_Harga-Discount;
printf("Total Harga=%0.0f\n",Total_Harga);
printf("Discount=%0.0f\n",Discount);
printf("Total Bayar=%0.0f",Total_Bayar);
printf("\n");
getch();
}
OUTPUT PROGRAM
0 Response to "listing program penentu harga barang dalam penjualan dengan Bahasa C"
Post a Comment
masukan komentar