While purchasing certain items, a discount of 10% is offered if the quantity purchased is more than 1000. If quantity and price per item are input through the keyboard, write a program to calculate the total expenses.


 
#include<stdio.h>

void main()

{

//ProgramWithHarsh//

int qty,dis=0;

float Total,rate ;

printf("\n Quantity of item = ");

scanf("%d",&qty);

printf("\n Rate of item =");

scanf("%f",&rate);

if(qty>1000)

dis=10;

Total=(qty*rate)-(qty*rate*dis/100);

printf("Total expenses=Rs. %f",Total);

}

The output will be

Post a Comment (0)
Previous Post Next Post