2.0: Boolean Type

In this module we'll be setting up a new console app to be used for learning about boolean types and boolean logic.

File Location

To set up a new console project, do the following steps: 1. Right click on the solution you made in the first module 2. Go to Add > New Project and select Console App (.NET Framework) 3. Name it 0.02_Booleans 4. Go to Program.cs. 5. You will write your code for this module within Program.cs of that project

Description

  • The type bool represents a boolean value

  • The value can either be true or false

  • The default value is false

Visual Representation

    class Program
    {
     //   1        2         3
        bool isEmployed = false;
    }
  1. Data type

  2. Declaration with a variable name

  3. Initialization with value associated to data type

Next: Boolean Operators

Last updated