+ 2
Can anyone help me with Boolean logic?how do we use in programs
3 Respostas
+ 12
Boolean logic is used for controlling the flow of a program. Think about where you mostly encounter operators like <, >, or ==: loops and conditional (if) statements. Your choose what your code does add those points based upon the state of the program.
Sometimes it is fairly simple, a single comparison is all you need... but what if that doesn't cut it? Then you bring in more operators, like AND, OR, NOT to build the right test for which path your program takes.
+ 2
boolean logic or boolean is a varible type like int or float whose value can be either true or false for eg. `boolean todayIsSunday = true; ` this site explains it in more detail http://www.webopedia.com/TERM/B/Boolean_logic.html
+ 2
if u want ur program to return only 2 options ie true or false u can use bool value .bool value also can be 0 or 1.