if.or

/ Conditionals / if.or

 

Title : if.or
Purpose : For executing a certain code block when either one of the multiple conditions becomes true.
Syntax :
Input Parameters : cond: (Required) Condition to compare

equal: (Required) The value which needs to be equal to the condition

not_equal:  (Required – either equal or not_equal)

The value which should not be equal to the condition

Return Value : (void) It won’t return anything, instead it will execute the codes when the condition becomes true.
Example 1 :
Code :

Output : It will display the text “Hello, Start your engine” when either fuel

or key is present.

Description : In this example we are displaying a text when either one of the two conditions becomes true.
Categories
Most Popular

Leave a Reply

Your email address will not be published. Required fields are marked *