Enter the price of product
if price more than equal to 20000
discount=5%
price more than equal to 10000
discount=3%
price less than equal to 10000
discount=1%
#include<stdio.h>
float main()
{
float a,b,c,d,sp1,sp2,sp3;//As the price can be in decimal the variables are declared in float
printf("Enter the amount of the product: ");
scanf("%f",&a);//Input for the price of the product
b = (a*5)/100;//Calculation for 5% of the product
sp1 = a-b;//Calculation of selling price
c = (a*3)/100;//Calculation for 3% of the product
sp2 = a-c;//Calculation of selling price
d = (a*1)/100;//Calculation of the 1% f the product
sp3 = a-d;//Calculation of selling price
if(a>=20000)//Checking if the price is more than 20000
printf("The selling price is: %f",sp1);//Printing the selling price
else if(a>=10000)//Checking if the price is more than 10000
printf("The selling price is: %f",sp2);//Printing the selling price
else//Checking if the price is less than 10000
printf("The selling price is: %f",sp3);//Printing the selling price
}