Menu Close

While purchasing certain items, a discount of 10% is offered…[Cprogm] FcukTheCode

While purchasing certain items, a discount of 10% is offered by the popular super market if the quantity purchased is more than 1000.

Since number of people purchasing is increasing day by day the owner of the super market feels that the discount calculation will be better if there is a automated software that gives the total expenses If the quantity and price per item are input.

Input:
Integers representing quantity and price respectively.

Output:
Print the total expenses of the purchased items.
#include <stdio.h>
int main()
{
    int price,quantity,totexp;
    scanf("%d %d",&price,&quantity);
    if(price>1000)
    totexp=((price*quantity)-(0.1*price*quantity));
   else
  
    totexp=price*quantity;
printf("%d",totexp);
return 0;
}

INPUT_1:
1550  827

OUTPUT:
1153665



INPUT_2:
759  235

OUTPUT:
178365