#include <stdio.h>
main()
{
float j,h,hbrg,diskon,jb;
printf("inputkan jumlah barang:");
scanf("%f",&j);
printf("inputkan harga barang:");
scanf("%f",&h);
hbrg=j*h;
printf("Jumlah harga barang = %.2f\n",hbrg);
if (hbrg>=50000)
{
diskon=0.5*hbrg;
j=hbrg-diskon;
}
if (hbrg<50000)
{
diskon=0.2*hbrg;
jb=hbrg-diskon;
}
printf("jumlah diskon = %.2f\n", diskon);
printf("jumlah bayar = %.2f\n", jb);
}
No comments:
Post a Comment