-->
English French German Spain Italian Dutch Russian Portuguese Japanese Korean Arabic Chinese Simplified French Italian Dutch English German

Minggu, 01 April 2012

contoh program condisi dalam turbo c++


#include<stdio.h>
#include<conio.h>
#include<iostream.h>
main()
{
double tot_beli, potongan=0, jum_bayar=0;
clrscr();
printf("=================================\n");
cout<<"TOTAL PEMBELIAN Rp. ";
cin>>tot_beli;
if (tot_beli >= 50000)
potongan=0.2*tot_beli;
else
potongan=0.05*tot_beli;

cout<<"BESAR POTONGAN Rp. "<<potongan<<endl;
jum_bayar=tot_beli-potongan;
cout<<"JUMLAH YANG HARUS DIBAYAR Rp. "<<jum_bayar;
printf("\n=================================");
getch();
}

Tidak ada komentar:

Posting Komentar