0

Multiple if

how to give intervals between ages ...like -if age is between 18to 42......print adult....what is the operation for the above sentence.

5th Jun 2017, 6:44 AM
Sachin s
Sachin s - avatar
4 Respostas
+ 2
if (age >= 18 && age <= 42) { ... }
5th Jun 2017, 6:54 AM
Igor B
Igor B - avatar
0
how do u do the same for switch statements...
6th Jun 2017, 4:26 PM
Sachin s
Sachin s - avatar
0
Unfortunately, you can't in C++.
6th Jun 2017, 5:13 PM
Igor B
Igor B - avatar
0
ya ....i tried it .....was showing error ....is there other way for giving intervals
6th Jun 2017, 5:13 PM
Sachin s
Sachin s - avatar