+ 2
Someone can explain me more about{if and alse} becouse I getting confused??
3 Antworten
+ 5
if this statement is true, do something.
else, if that was false, if this statement is true, do something.
else, if everything was false, do something.
Or, if written in code:
if(condition)
{
// do something if true
}
else if(condition)
{
// do something if true, if above was false
}
else
{
// do something if all are false
}
*for statements that are not nested*
+ 2
if: You evaluate for example the two variables. When your evaluation is true the execution of the code in {} of the if statement will continue.
else: when the none of the statements are true you use else