// 비트연산자
// & : AND : 논리곱
// | : OR : 논리합
// ~ : NOT : 부정
// ^ : XOR : 배타적논리합

using System;

public class 비트연산자
{
    public static void Main()
    {
        int a = 3;
        int b = 2;
        int r = 0;

        r = a & b;
        Console.WriteLine(r); // 2
        r = a | b;
        Console.WriteLine(r); // 3
        r = ~a;
        Console.WriteLine(r); // -4
        r = a ^ b;
        Console.WriteLine(r); // 1

    }
   
}

Posted by holland14
: