+ 5

If statements

Can if statements be chained inside each other?

1st Dec 2017, 12:01 AM
Owolawi Kehinde
Owolawi Kehinde - avatar
3 Antworten
+ 13
They can be chained together, and nested inside each other, however you need for your program. //Chaining if () {} else if () {} ... else {} //Nesting if () { if () { if () {} } else if() {} else {} }
1st Dec 2017, 12:04 AM
Tamra
Tamra - avatar
+ 3
yep and they can be nested as deep as you wish
1st Dec 2017, 4:11 AM
᠌᠌Code X
᠌᠌Code X - avatar