+ 2

Can anyone help me with Boolean logic?how do we use in programs

25th Jun 2017, 4:56 AM
Nilanjan Paul
Nilanjan Paul - avatar
3 Antworten
+ 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.
25th Jun 2017, 5:54 AM
Jim
Jim - avatar
+ 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
25th Jun 2017, 5:37 AM
Oxide Debbarma
Oxide Debbarma - avatar
+ 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.
25th Jun 2017, 7:31 AM
MrApr1