1: #include<stdio.h>
2: #include<conio.h>
3: void main()
4: {
5: float gross,dis;
6: printf("Enter the gross amount:");
7: scanf("%f",&gross);
8: dis=0.00;
9: if(gross>2000.00)
10: dis=0.20*gross;
11: else if(gross>1000.00)
12: dis=0.15*gross;
13: else if(gross>500.00)
14: dis=0.10*gross;
15: printf("Gross amount %8.2f\n",gross);
16: printf("Discount %8.2f\n",dis);
17: printf("net amount %8.2f\n",gross-dis);
18: getch();
19: }
No comments:
Post a Comment