-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnestedif3.cpp
More file actions
55 lines (40 loc) · 918 Bytes
/
nestedif3.cpp
File metadata and controls
55 lines (40 loc) · 918 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// #include <iostream>
// using namespace std;
// int main ()
// {
// int a,b,c;
// float avg;
// cout<<"enter marks of three subjet(out of 100) : a, b, c ";
// cin>>a>>b>>c;
// avg=(a+b+c)/3.0;
// //use .0 in case we want to show float value
// if(avg>=60)
// {cout<<"a-grade ";
// cout<< avg;}
// else if (avg>=35&&avg<60)
// {cout<<"b-grade ";
// cout<< avg;
// }
// else
// {cout<<"c-grade";}
// return 0;
//}
#include <iostream>
using namespace std;
int main ()
{
int a;
float discounted_bill;
cout<<"value of bill";
cin>>a;
if(a>=5000)
{discounted_bill=a-((a*20)/100.0);
cout<<discounted_bill;}
else if (a>2000&&a<5000)
{discounted_bill=a-((a*10)/100.0);
cout<<discounted_bill;}
else
{discounted_bill=a-((a*20)/100.0);
cout<<discounted_bill;}
return 0;
}