move to repo.or.cz
[letusc.git] / ch2 / examples / example2.c
blob7904599585949e3404b49869954a8b8d770d86b3
1 #include<stdio.h>
3 /* calculation of total expenses*/
6 int main(void)
8 int qty;
9 float rate;
10 int dis;
11 float expense;
13 printf("Enter quantity and rate per item: ");
14 scanf("%d %f",&qty,&rate);
16 if(qty>1000)
17 dis = 10;
19 expense = (rate*qty)-(0.10*rate*qty);
21 printf("The total expense is %.2f\n",expense);
23 return 0;