We won’t go into detail on the control structures right now because here we are just introducing them and the best way to learn control structures is to use them. But one thing we should know is that the statement “break” can be used to break out of a loop, as shown below.
In this code, we have included an “if” statement inside the “do” loop that checks for the condition of the value nPrice being less than or equal to 0. If that condition is “true” we want to break out of the loop, because less than or equal to 0 is not a valid value for nPrice.
This example also demonstrayes that control structures can be “nested”. The “if” structure is nested inside the “do / while” structure.This nesting can be done to any level, making it possible to create incredibly powerful programs.
|&||And||Compares two bits, if both are 1, the result is 1.|
||||Or||Compares two bits, if one or the other is 1, the result is 1.|
|^||XOr||Compares two bits, if one or the other, but not both, is 1, the result is 1.|
|>>||Shift left||Shifts the bits to the left.|
|<<||Shift right||Shifts the bits to the right.|
We won’t go into detail on the bitwise operators right now because they are used only in very sophisticated programming. We will save learning how to do kind of programming for the future.