0
How does one use Boolean?
this service does little to explain how everything fists together and how to structure your code. so how does one use Boolean? and anything else?
2 Respuestas
+ 8
Boolean is use to get a more specific answer or value in a given condition by using boolean operators.
Boolean value is either True or False
You use AND or && if BOTH statement is TRUE the outcome is TRUE else it's False
You use OR or || if EITHER statement is True it will return TRUE else it's False
and so on... hope it helps.😊
+ 4
Boolean is a data type that is used to evaluate a condition. A variable of Boolean type contains only 2 possibilities, true or false. Practical use of Boolean type is for storing a result of an expression evaluation, or decision making within code.
Let's see some examples, without language concerns;
1 is less then 2, this expression evaluates to true,
2 is less then 1, this expression evaluates to false.
A typical use in coding, goes like:
if conditions then
code to execute if conditions evaluates true
else
code to execute if conditions evaluates false
Hth,