How to use bool variable in C#? | Sololearn: Learn to code for FREE!


How to use bool variable in C#?

I am completely new to C#, and i don't quite understand how to use the bool variable. Help?

4/9/2019 1:57:59 PM

Милан Ковачевић

2 Answers

New Answer


bool is either true or false. Like: bool test = false; return test; //Prints false


Bool is used a lot in decision making. Together with a if statement. It is either true or false You can use it to have variables that are either true or false. Like IsMale HasDog