C# 삼항 연산자
x = 15; string result = (x > 10) ? "x is greater than 10" : "x is not greater than 10"; Console.WriteLine(result);위의 예제에서 (x > 10) ? "x is greater than 10" : "x is not greater than 10" 부분은 삼항 연산자를 사용한 것입니다. 조건 x > 10을 평가하고, 이 조건이 참이면 "x is greater than 10"을, 거짓이면 "x is not greater than 10"을 선택하여 result 변수에 할당합니다.