#include<stdio.h>
int main(){
int quantity;
float price;
float totalExpenses;
printf("Enter the quantity purchased\n");
scanf("%d",&quantity);
printf("Enter the price per item \n");
scanf("%f",&price);
if(quantity>10){
totalExpenses = quantity * price;
totalExpenses = totalExpenses - (totalExpenses * 0.1);
}
else{
totalExpenses = quantity * price;
}
printf("Total Expenses is: %f",totalExpenses);
}
Comments
Leave a comment