First, keep this
chart [
^] with you and refer to it all the times.
Let do one example, this line without parenthesis
12 > 10 || 12 <= 5 && 12 != 12
The precedence order is like this: (Higher precedence on the left)
!, <= , !=, &&, ||
so that line becomes:
true || false && false
Since && takes precedence over ||, it next becomes:
true || false
What is the final outcome, true!
You should be able to figure out the other one. My advice is always use parenthesis to make your intention clear and explicit.