0
Please can someone explain the use of Booleans in simple words in projects with a project example
Related to Booleans
2 Respostas
+ 4
Inder Saundh
boolean means true or false
In life there might be 2 situation one for 'yes' and one for 'no' so if this is right then 'yes' and if this is wrong then 'no'
Same boolean works in programming world.
if (true)
//print 'yes'
else
//print 'no'
For example a = 10, b = 20
Now we need to get which number is big
if (a > b) {
cout << "a is bigger than b";
} else {
cout << "b is bigger than a";
}
Here if (a > b) is true then statement inside 'if' will be print if (a > b) is false then statement inside 'else' will be print
+ 4
Inder Saundh ,
here are 3 links to short tutorials about conditional statements for python from the community section:
https://www.sololearn.com/learn/Python/2277/?ref=app
https://www.sololearn.com/learn/Python/2278/?ref=app
https://www.sololearn.com/learn/Python/2500/?ref=app