Can you put an if/else statement inside an if/else statement? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Can you put an if/else statement inside an if/else statement?

6th Sep 2016, 2:08 PM
Friederick Tan
Friederick Tan - avatar
8 Answers
+ 1
yes you can, but you are going to make a complicated "if else statement" if this doesn't meet the same "int" on the upper part. They are called loops
9th Sep 2016, 10:14 PM
Salad
Salad - avatar
+ 1
Yupp
18th Sep 2016, 6:06 AM
M.Sairam
M.Sairam - avatar
+ 1
posibilities ..but loops gets complicated
9th Nov 2016, 4:38 PM
Gopinatha
Gopinatha - avatar
+ 1
You can even go deeper and add another if statement, but it will get more complicated and less clear the more you add. Better use if statements or select cases with logic arguments. If A & B is better than If A If B
11th Nov 2016, 5:14 PM
Baptiste Corneglio
Baptiste Corneglio - avatar
+ 1
yes ,you can!
20th Nov 2016, 10:11 AM
Shivam Singhal
Shivam Singhal - avatar
+ 1
nested if else
21st Nov 2016, 8:09 AM
john backong
john backong - avatar
+ 1
yes you can
23rd Dec 2016, 9:58 AM
Gaurav Salunke
Gaurav Salunke - avatar
+ 1
yes you can
11th Jan 2017, 2:34 PM
xtron