Penyeleksian Kondisi IF .... ELSE

#include <conio>

#include <iostream>

#include <stdio>

main ()

{

double tot_beli,pot=0,jum_bayar=0;

clrscr();

cout<<”Total Pembelian Rp. “;cin>>tot_beli;

if (tot_beli>=50000)

pot=0.2 * tot_beli;

else

pot=0.05*tot_beli;

cout<<”Besarnya Potongan Rp. “<<

jum_bayar=tot_beli-pot;

cout<<”jumlah yang harus dibayarkan Rp. “<

getch();

}

Jika total >= 50.000 maka potongan 20%, tapi jika total < 50.000 tidak ada potongan clip_image001clip_image002

Comments