Hello!
First of all, you can either use the “</>” option to format the code you want to write, or just screenshot it, because it is difficult to read.
Now for your question, the two pieces of code will behave exactly the same. If “Cond a” is not true, then don’t bother to even go through the rest of it, just do “code b”. If it is true, then check for “cond a.1” and do the rest.
Both examples work the same, with the latter being a little more simplified.
Return, will resume the program from where the function was called. What it returns, depends on the function type. Is your function of type void? Then it returns nothing, it just exits the function. Is it int? Then return a number like 0 or 1 and use them to see if the “Cond a” was indeed true or not.
void Mike()
{
if (!Cond a)
{
code b
return; //exits function, returns NOTHING
}
else if (Cond a.1) //The program will go here if Cond a is true, so I am using "else if" instead of "if"
{
code a.1
return; //Same as above
}
code a.2
}
Hope it helps.