Hello,
Boolean is a datatype that will return u only two values either true or false the code which you have displayed will defiantely return a true value because u have declared a Boolean value named B and initialized a value true to it and displayed b if u wana try some examples with boolean then my friend heres the right code for you
using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
bool b = true;
int a = 10;
if (a < 1)
{
Console.WriteLine("value of b is :"+b);
}
else
{
b = false;
Console.WriteLine("value of b is :" + b);
}
}
}
}
just try changing value for integer variable "a" and u will see the trick...
Now coming to the first part of your question thats difference between bool and Boolean
my friend bool is an alias for System.Boolean jsut like int is an alias for System.Int32 thats it :)
please do rate my answer once u find it useful
Thanks & Regards
Radix :rose: