kisame1313

& and | statement

Jul 12th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.85 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4.  
  5. namespace Task_1_3_5
  6.     {
  7.     class Program
  8.         {
  9.         static void Main()
  10.             {
  11.             int x = 1;
  12.             int y = 1;
  13.             int z = 1;
  14.             if (y!=++x & x==++z | z!=x)
  15.                 {
  16.                 Console.WriteLine("State 1: x:" +x+" y:"+y+" z:"+z);
  17.                 }
  18.             if( x==++z & y!=++x | z!=x)
  19.                 {
  20.                 Console.WriteLine("State 2: x:" +x+" y:"+y+" z:"+z);
  21.                 }
  22.             if(z!=x | x==++z & y!=++x)
  23.                 {
  24.                 Console.WriteLine("State 3: x:" +x+" y:"+y+" z:"+z);
  25.                 }
  26.             if(z!=x | y!=++x & x==++z)
  27.                 {
  28.                 Console.WriteLine("State 4: x:" +x+" y:"+y+" z:"+z);
  29.                 }
  30.             }
  31.         }
  32.     }
Advertisement
Add Comment
Please, Sign In to add comment