0

Someone please explain the if & else statement to me...I'm kinda struggling with that...

If else statement

28th Jun 2018, 5:08 PM
Innocent
Innocent - avatar
3 Answers
+ 6
In most programming languages, if...else block is used when you need to make a decision for which block of code should be executed next, depending on some condition(s) that are evaluated. The if...else block is used when you decided that there should only be two options to choose. If you use 'else if' it means you have multiple options (more than two), to each the condition(s) is evaluated for. C++ or Java: bool youAreYoung = true; if(youAreYoung) { // This block is executed // if youAreYoung is true } else { // This block is executed // if youAreYoung is false } Hth, cmiiw
29th Jun 2018, 8:41 AM
Ipang
+ 3
in what programming language
28th Jun 2018, 5:15 PM
LONGTIEšŸ‘”
LONGTIEšŸ‘” - avatar
28th Jun 2018, 5:22 PM
LONGTIEšŸ‘”
LONGTIEšŸ‘” - avatar