What is bool? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What is bool?

20th Sep 2016, 3:29 PM
gowtham.c
8 Answers
+ 3
true and false or 1 and 0
21st Sep 2016, 10:45 PM
Sezgin GÜL
Sezgin GÜL - avatar
+ 3
The bool keyword is an alias of System.Boolean. It is used to declare variables to store the Boolean values, true and false.
22nd Sep 2016, 2:26 PM
Adulkhaliq Q Hamad
Adulkhaliq Q Hamad - avatar
+ 2
bool is short term for boolean. boolean represents expression that results to TRUE or FALSE.
20th Sep 2016, 8:16 PM
Erwin Mesias
Erwin Mesias - avatar
+ 2
And is a value type wich cant be null
20th Sep 2016, 10:15 PM
Minickyi
+ 2
public class BoolTest { static void Main() { bool b = true; // WriteLine automatically converts the value of b to text. Console.WriteLine(b); int days = DateTime.Now.DayOfYear; // Assign the result of a boolean expression to b. b = (days % 2 == 0); // Branch depending on whether b is true or false. if (b) { Console.WriteLine("days is an even number"); } else { Console.WriteLine("days is an odd number"); } } } /* Output: True days is an <even/odd> number */
22nd Sep 2016, 2:28 PM
Adulkhaliq Q Hamad
Adulkhaliq Q Hamad - avatar
0
it's logical variable ( yes , no )
25th Sep 2016, 8:58 PM
Ahmed Breeka
Ahmed Breeka - avatar
0
You can do bool x = true; or bool y = false;
12th Oct 2016, 3:10 PM
bernhard
0
bool (boolean) is a data type which stores true/false values.
16th Dec 2016, 1:11 AM
julio