Boolean Type के लिए, bool Keyword का उपयोग किया जाता है और यह System.Boolean का Alias है।
इसका उपयोग Boolean Values, True और False को Store करने के लिए Variables Declare करने के लिए किया जाता है।
आइए एक Example देखते हैं कि C# में bool का उपयोग कैसे करें।
Example
using System; public class Demo { static void Main() { bool val = true; int d = DateTime.Now.DayOfYear; val = (d % 2 == 0); if (val) { Console.WriteLine("days: even number"); } else { Console.WriteLine("days: odd number"); } } }