Operators and Loops
There are Tow Types of Operators : Comparison Operators and Logical Operators
Comparison operators :
Comparison operators allow you to compare two values. it used in logical statements to determine equality or difference between variables or values .
Operator | Description |
---|---|
equal to | == |
equal value and equal type | === |
not equal | != |
not equal value or not equal type | != |
greater than | > |
less than | < |
greater than or equal to | >= |
less than or equal to | <= |
Logical Operators
Logical operators are used to determine the logic between variables or values.
&& (and)
|| (or)
! (not)
Loop
I loop is a programming structure that repeats a sequence of instructions until a specific condition is met.
- for loop: is a loop that runs for a preset number of times.
- while loop is a loop that is repeated as long as an expression is true.
- do while loop or repeat until loop repeats until an expression becomes false.
loop life cycle:
- initialization
- check condition
- update Initial value