Code for Program to calculate net bill by deducting discount in C Programming
#include<stdio.h>
void main()
{
float number1,disc,bill;
printf("Total purchace=>");
if(scanf("%f",&number1)==1)
{
if(number1>1000)
disc=number1*0.04;
elseif(number1>500)
disc=number1*0.02;
else
disc=0;
bill=number1-disc;
printf("\nYour bill is Rs.%9.2f",bill);
}
else
{
printf("error enter correct value");
}
}
=======================OUTPUT==========================
Total purchace=>800
Your bill is Rs. 784.00
Total purchace=>300
Your bill is Rs. 300.00
Total purchace=>1220
Your bill is Rs. 1171.20