//运算符与表达式实例
using System;
namespace sample2_1
{
class Program
{
static void Main(string[] args)
{
int x = 13 % 6;
int y = 13 ^ 6;
y = y ^ 6;
int a = 13;
int b = 6;
//a=a+b;
//b=a-b;
//a=a-b; //若a和b的值较大,则a+b会溢出
a = a ^ b;
b = b ^ a;
a = a ^ b; //二次亦或,完成 a,b交换
Console.WriteLine("a={0},b={1}",a,b);
Console.WriteLine(13>>2); //13右移两位,值为3
Console.WriteLine(13<<3); //13左移三位,值为104
Console.ReadKey();
}
}
}