Skip to content

Latest commit

 

History

History
98 lines (61 loc) · 4.02 KB

Read08.md

File metadata and controls

98 lines (61 loc) · 4.02 KB

Evaluating Conditions in opreators:

so simply it mean comparing a Value to other in the script.. the result will be onr of tow (True OR False)

  • Is Equal To :

cap

witch compares tow values to see if they are the same

  • Strict Equal to :

cap

witch used to compare two values to cheak that both the data type are same

  • Is Not Equal To :

cap

witch compares tow values to see if they are the Not the same

  • Strict Not Equal To :

cap

witch used to compare two values to cheak that both the data type are Not the same

  • Greater Than :

cap

witch cheaks if the numbers on the left is greater than the numbers in the right

  • Greater Than Or Equal To :

cap

witch cheaks if the numbers on the left is greater or equal the numbers in the right

  • Less Than :

cap

witch cheaks if the numbers on the left is less than the numbers in the right

  • Less Than Or Equal To :

cap

witch cheaks if the numbers on the left is less or equal the numbers in the right

Logical Operators :

whitch alows you compare the results of more than 1 comparison operator

  • Logical AND (&&) :

it tastes if the both evalute to true then the expression returns true if just one of these it returns false

  • Logical OR (||) :

it taset if either expression evaluates to true then the expression returns true if the both is flase it returns false

  • Logical NOT (!) :

it just takes a single boolean value and inverts it

cap

Loops :

its another kind of cheak conditions, if it returns true the code after will run, then it will recheak again if it is still return true and keep cheak and run until returns flse and there is 3 typs of loops: cap

1. FOR : it is usually a counter which is used to tell how many times loop should run..

2. WHILE : you can use while if you dont know how many times the code will keep loop, it will keep loop until the condition is true and its like :

cap

3. DO WHILE : its same of ehile loop but in difference: it will always run thr statments inside the curly braces at least once, even if the condation evaluates to false..

Loops Counters :

when the loop used to counter for how many times it should repeat, so the counters loops must had 3 main sections:

  1. Initialization : wich it basicly creating the varuble inside the loop

cap

  1. Condition : the loop should continue to run until the counter reaches specified number

cap

  1. Update : evrey time the has run the statment in the curly braces, it will adds the update to the varuble (it is usualy adds 1) like:

cap

So simply looping be something like :

cap

cap cap




Back To The Main Page