Friday, 11 May 2012

Calculate Bill After Discount in C


#include <iostream.h>
#include <conio.h>
void main ()
{
int bill, disc, total, qty, cost;
cout <<" Enter Quantity: ";
cin >>qty;
cout <<" Enter Cost: ";
cin >>cost;
bill=qty*cost;
if (bill>200)
{
disc=bill*2/100;
}
else
{
disc=bill*3/100;
}
total=bill-disc;
cout <<"Total Bill After Discount: "<<total;
getch ();
}

No comments:

Post a Comment