Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace Theory2
- {
- class BitwiseLogicalOperators
- {
- static void Main(string[] args)
- {
- int _and = 56 & 28;
- int _or = 56 | 28;
- int _eor = 56 ^ 28;
- Console.WriteLine("56 => " + Convert.ToString(56,2).PadLeft(8,'0'));
- Console.WriteLine("28 => " + Convert.ToString(28, 2).PadLeft(8, '0'));
- Console.WriteLine("and => " + Convert.ToString(_and, 2).PadLeft(8, '0'));
- Console.WriteLine("==========================");
- Console.WriteLine("56 => " + Convert.ToString(56, 2).PadLeft(8, '0'));
- Console.WriteLine("28 => " + Convert.ToString(28, 2).PadLeft(8, '0'));
- Console.WriteLine("or => " + Convert.ToString(_or, 2).PadLeft(8, '0'));
- Console.WriteLine("==========================");
- Console.WriteLine("56 => " + Convert.ToString(56, 2).PadLeft(8, '0'));
- Console.WriteLine("28 => " + Convert.ToString(28, 2).PadLeft(8, '0'));
- Console.WriteLine("eor => " + Convert.ToString(_eor, 2).PadLeft(8, '0'));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement