%Boolean algebra clear %clears everything. x = 10; %Now x = 10. y = 1; %What if we test ~(x < 2) ? ~(x < 2) %x < 2 is false, so its negation is true... %What if we test (x > 2)&(y<1) ? (x>2)&(y<1) %It is false since (y<1) is false... %But if we test (x>2)&(y>0) : (x>2)&(y>0) %Both are true, so the result is true. %Now what if we test (x > 2)||(y<1) ? (x > 2)||(y<1) %It is now true since only one is required to be true for %the or operator... %With this, we can already look at the next part : flow control. %Assume we want to perform some task only if x is positive. We could then %have : if( x >= 0 ) %If x is greater or equal than zero... %Begin conditionnal code display('I will execute all the code between those lines'); display('I could do many lines of stuff'); display('And then some !'); %End conditionnal code else %Begin the code if x is not greater or equal than zero. display('If x is greater or equal than zero, this will never be printed !'); end %End of the conditionnal statement. display('I am done now. Bye bye !');