Creator
Zj2tFQyYrMd6qyBmb73QaP0AKMW2
The result depends on the machine's collating sequence (e.g., ASCII character set), comparing their numerical ASCII values.
`if (logical expression) statement;` (or a compound statement in curly braces).
Relational operators are evaluated from left to right. `0 <= num` evaluates to a Boolean (0 or 1), then that Boolean result is compared to `10`, which often leads to an unintended `true` result for numbers outside the desired range.
If Expression is true (nonzero), result is false (0). If Expression is false (0), result is true (1).
`if (logical expression) statement1; else statement2;` (statement1 for true, statement2 for false, or compound statements).
() (Parentheses), ! (logical NOT), Arithmetic operators, Relational operators, Equality and inequality operators, Logical AND (&&), Logical OR (||).
It is executed only if the value of the logical expression is true. If false, the statement is bypassed, and the program proceeds to the next statement.
Decisions allow the program to perform different actions based on certain conditions.
Floating-point numbers may not behave as expected due to precision issues (e.g., 3.0/7.0 + 2.0/7.0 + 2.0/7.0 might evaluate to 0.99999999999999989 instead of 1.0).
Relational operators have higher precedence than equality operators. Both are lower precedence than arithmetic operators.
Selection and Repetition.
Space < ALL Digits < ALL uppercase letters < ALL lowercase letters.
== (Equal, not for assignment!), != (Not equal).
`bool`, `true`, and `false`.
Strings are compared character by character from left to right. Comparison continues until a mismatch is found or all characters are equal.
Result is true (1) only if both Expression1 and Expression2 are true (nonzero); otherwise, it's false (0).
A Boolean value that is either true or false.
1) Determine the condition to make the decision. 2) Tell the computer what actions to take if the condition is true or false.
They return an integer value of 1 if true, and 0 otherwise.
! (not), && (and), || (or).
An `else` is associated with the most recent `if` that has not already been paired with an `else`.
The shorter string is considered less than the larger string.
Result is true (1) if at least one of Expression1 or Expression2 is true (nonzero); result is false (0) only if both are false (0).
In sequence, Selectively (branch/making a choice), Repetitively (looping), By calling a function.
`true` has the value 1; `false` has the value 0.
> (Greater than), < (Less than), >= (Greater than or equal), <= (Less than or equal).