#include"stdio.h"
#include"conio.h"
double hitung(double total);
void main(){
double Harga,disc=0;
printf("Total Harga:");
scanf("%lf",&Harga);
printf("Discount:%.0lf",hitung(Harga));
}
double hitung(double total){
double discount;
if(total>=2000000)
discount=0.1*total;
else if(total>=1000000)
discount=0.5*total;
else
discount=0;
return(discount);
}
#include"conio.h"
double hitung(double total);
void main(){
double Harga,disc=0;
printf("Total Harga:");
scanf("%lf",&Harga);
printf("Discount:%.0lf",hitung(Harga));
}
double hitung(double total){
double discount;
if(total>=2000000)
discount=0.1*total;
else if(total>=1000000)
discount=0.5*total;
else
discount=0;
return(discount);
}
Tidak ada komentar:
Posting Komentar