answersLogoWhite

0

A boolean is a value which can either be true or false. A boolean condition is mathematical equation where the result is a boolean (either true or false). Often used in programming.

A boolean condition consists of some varibles, and boolean operations that can be carried out using them. Here are some boolean operations. The sybols are those used in Java and C++.

> Greater Than. Returns true when the number before > is greater than the number after

< Less Than. The opposite of Greater than

== Equals. If the values are equal returns true

OR Returns true if the boolean before and/or the boolean after is true

&& AND Returns true only if the boolean before AND after the && are true

! NOT Inverts/NOT's a boolean. True becomes false. False becomes true

Most programming languages have booleans as a type of variable and if statements as control flow.

An if statement uses a boolean to decide whether or not something is run eg.

if(someBoolean){

// If some boolean is true this peice of code will be run

}

A an example of a boolean condition could use a less than or greater than symbol

if( someNumber > 9000 ) {

print( "The number... it's.... OVER 9000!!" );

}

User Avatar

Wiki User

14y ago

What else can I help you with?

Related Questions

What Is a Boolean variable that signals when some condition exists in the program.?

flag


Or Boolean?

Combines two booleans and returns true if either condition is met


What is a variable that signals when a condition exists?

A Boolean variable can be used to signal when a condition exists. It can have a value of true or false based on whether the condition is met or not.


What java operator reverses the truth or falsity of a condition?

The ! (boolean invert) operator returns the opposite of a boolean's current value: if(!(7 5," and the statement produces this output: not equal


What is the Main diff for while and do while loop?

The main diff b/w while and do while is that for do while first the statment are exected then the condition is checked if the condition is true then again execute the statment and so on. But in case of while first the condition is checked if it is true then the statment are executed and so on. But in java the result of the condition is boolean eg. while(x=20) is not the condition in java it does not give any boolean answer.


Which boolean operation is referred to as a boolean product?

AND operation is referred as a boolean product


What type of loop uses a boolean expression?

A "while" loop is appropriate in this case - one in which the condition is evaluated at the beginning of the loop.


If Eat Hamburger?

AND boolean


What does the assert keyword do in visual C?

In debug compilation, assert takes in a Boolean condition as a parameter, and shows the error dialog if the condition is false. The program proceeds without any interruption if the condition is true. Varsha


The definition of a boolean operator?

what is boolean operator


What is the definition of boolean?

Exampe of Boolean and usage in the real word Operators Operator = Equal to != ^= Not equal to &lt; Less than Greater than &gt;= Greater than or equal to is null Value is null is not null Value is other than null like Value is an instance of pattern-matching string not like Value is not an instance of pattern-matching string Condition is a Boolean value (&quot;Petar&quot; === &quot;John&quot;) //This is false (&quot;Petar&quot; === &quot;Petar&quot;) This is true if (condition) { code to be executed if condition is true; }


What year did George Boole develop boolean algebra?

what is the contribution George Boolean to the development of Boolean operations