The following is valid. Only the if requires brackets,if (true) a=1;
else a=2;
the else doesn't require them, and that's the inconsistent part.if (true) {a=1;}
else a=2;
Moderator: Martin
The following is valid. Only the if requires brackets,if (true) a=1;
else a=2;
the else doesn't require them, and that's the inconsistent part.if (true) {a=1;}
else a=2;
Code: Select all
if (true) {a=1;}
else {a=2};
Code: Select all
if(true)
{
a = 1;
}
else
{
a = 2;
}
Code: Select all
if(true)
a = 1
else
a = 2;
Code: Select all
if(true) a = 1 else a = 2;
Code: Select all
a = if(true) 1 else 2;