Quote:
| i have no idea how they work |
The boolean operators: AND (&&), or (||) and ! are used to combine boolean expressions to return a single boolean value:
For example:
(a>b) && (c<d) would return true if a is greater than b AND c is greater than d
(a>b) || (c<d) would return true if a is greater than b OR c is greater than d
!(a>b) would return true if a is NOT greater than b (ie less or equal)
Please edit your code and properly format it to show logic nesting levels. Statements within {} should be indented.
Can you explain what happens when you execute your program?
Post the contents of the console that shows what you enter and what it prints out and explain what is wrong.
In windows To copy the contents of the command prompt window:
Click on Icon in upper left corner
Select Edit
Select 'Select All' - The selection will show
Click in upper left again
Select Edit and click 'Copy'
Paste here.