Files
Ojt.Lectures/Ex8.Operators/Program.cs
T
2025-03-05 10:21:10 +09:00

38 lines
579 B
C#

// See https://aka.ms/new-console-template for more information
int x, y, z, b, c, d;
x = y = z = b = c = d = 2;
//산술연산자
int a = (x + y - z) * (b / c) % d;
//할당연산자
int sum = 0;
sum += a;
//증감연산자
sum++;
--sum;
//논리연산자
bool isOk = true;
if ((a > 1 && b < 0) || c == 1 || !isOk);
//비교연산자
if (a <= b)
{
int rst = b - a;
}
//비트연산자
byte b1 = 7;
int b4 = (b1 & 3) | 4 ^ 5;
//비트이동연산자
int i = 2;
i = i << 5;
//조건연산자
int val = (a > b) ? a : b;
string str = null;
string s = str ?? "(널)";