Selasa, 24 Desember 2013

Menghitung nilai discount menggunakan if.

Menghitung nilai discount menggunakan if.

#include <stdio.h>
main()
{
double total_pembelian, discount = 0;
printf("Total pembelian = Rp ");
scanf("%lf", &total_pembelian);
if(total_pembelian >= 100.000)
discount = 0.05 * total_pembelian;
printf("Besarnya discount = Rp %.2lf\n", discount);
}

............SEMOGA BERHASIL......

Popular Posts