VelizarAvramov

05. Boolean Variable

Nov 28th, 2019
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.45 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _05._Boolean_Variable
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string varInput = Console.ReadLine();
  10.  
  11.             bool toBoolean = Convert.ToBoolean(varInput);
  12.  
  13.             if (toBoolean)
  14.             {
  15.                 Console.WriteLine($"Yes");
  16.             }
  17.             else
  18.             {
  19.                 Console.WriteLine("No");
  20.             }
  21.         }
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment