constk

Some C# funny test drive

Feb 28th, 2021 (edited)
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.84 KB | None | 0 0
  1. using System;
  2. using System.Globalization;
  3.  
  4. namespace CSharpTest
  5. {
  6.     class Program
  7.     {
  8.         static void Main(string[] args)
  9.         {
  10.             CultureInfo.CurrentCulture = new CultureInfo("en-US", false);
  11.  
  12.             int i = 0;
  13.             int j = 5;
  14.             if(i == 1 & Convert.ToBoolean(j = 6))
  15.                 Console.WriteLine("Boo!");
  16.             Console.WriteLine(j);
  17.  
  18.             if (i == 1 && Convert.ToBoolean(j = 7))
  19.                 Console.WriteLine("Boo!");
  20.             Console.WriteLine(j);
  21.  
  22.             if (i == 0 || Convert.ToBoolean(j = -6))
  23.                 Console.WriteLine("Boo!");
  24.             Console.WriteLine(j);
  25.  
  26.             if (i == 1 | Convert.ToBoolean(j = -6))
  27.                 Console.WriteLine("Boo!");
  28.             Console.WriteLine(j);
  29.  
  30.             Console.ReadKey();
  31.         }
  32.     }
  33. }
  34.  
Add Comment
Please, Sign In to add comment