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

+1

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

+3

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

+1

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 https://code.sololearn.com/c9BkvxhRH3pM/?ref=app