Condition | SoloLearn: Learn to code for FREE!

0

Condition

Does if and else condition stand together in code function?

12/30/2016 9:58:32 AM

Rizwan Aslam

3 Answers

New Answer

+6

Like what Nahuel said, 'if' can stand alone while 'else' can only exist if 'if' exist. ... now that hurts my brain. E.g. if (x == 1) { //codes } is valid, if (x == 1) { //codes } else if (x == 2) { //codes } is valid, else { //codes } is not valid.

+1

not sure what is "stand together" but there can not be an else without if.

+1

All else are if but not all if are else. lol