-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathifelseif.cpp
39 lines (32 loc) · 849 Bytes
/
ifelseif.cpp
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
//2.3: Program to take input from user to go shopping with her friends depned on the how much saving we have?
#include <iostream>
using namespace std;
int main() {
int savings;
cin>>savings;
//if condition
if(savings>5000) {
cout<<"RoadTrip with Nitesh\n"<<endl;
} else {
cout<<"Shopping with Nitesh"<<endl;
}
/*output: Inout Price:4000
Shopping with Nitesh
*/
//ifelseif
int monthlySavings ;
cin>>monthlySavings;
if(monthlySavings>6000) {
if(monthlySavings>10000) {
cout<<"Valley Trip with Abhi";
} else {
cout<<"Local Tour with Abhi";
}
}
else if (monthlySavings>2000) {
cout<<"Dinner With Aniket";
} else {
cout<<"Dinner with Sister";
}
return 0;
}