Advertisement
kisame1313

& and | statement v 2

Jul 12th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.23 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.  
  12.             int x = 1;
  13.             int y = 1;
  14.             int z = 1;
  15.  
  16.             if (y!=++x & x==++z | z!=x)
  17.                 {
  18.                 Console.WriteLine("State 1: x:" +x+" y:"+y+" z:"+z);
  19.                 }
  20.  
  21.             x=1;
  22.             y=1;
  23.             z=1;
  24.             if ( x==++z & y!=++x | z!=x)
  25.                 {
  26.                 Console.WriteLine("State 2: x:" +x+" y:"+y+" z:"+z);
  27.                 }
  28.  
  29.             x=1;
  30.             y=1;
  31.             z=1;
  32.             if ( ++x==z & y!=x | x != z)
  33.                 {
  34.                 Console.WriteLine("State 3: x:" +x+" y:"+y+" z:"+z);
  35.                 }
  36.  
  37.             x=1;
  38.             y=1;
  39.             z=1;
  40.             if(x==z | x != y & y==--z)
  41.                 {
  42.                 Console.WriteLine("State 4: x:" +x+" y:"+y+" z:"+z);
  43.                 }
  44.  
  45.             x=1;
  46.             y=1;
  47.             z=1;
  48.             if ( ( x==z | x != y ) & y==--z)
  49.                 {
  50.                 Console.WriteLine("State 5: x:" +x+" y:"+y+" z:"+z);
  51.                 }
  52.             }
  53.         }
  54.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement