/* Calculation of total expenses */ #include int main() { int qty, dis = 0; float rate, tot; printf("Enter quantity and rate\n"); scanf("%d %f", &qty, &rate); if (qty > 1000) dis = 10; tot = (qty * rate) - (qty * rate * dis / 100); printf("Qty %d rate %f Total expenses = Rs. %f\n", qty, rate, tot); }