byte
-
2/23 : TIL | decimal m, 조건 연산자, 비트 연산자Today I Learned/C# 2023. 2. 23. 14:03
decimal m - (실습) 화씨 섭씨 계산하기. 소수점 표시하기 int fahrenheit = 94; decimal celsius = (fahrenheit - 32) * 5/9m; //decimal type: m을 필수로 붙여줘야 함 Console.WriteLine($"The temperature is {celsius} Celsius."); //결과: The temperature is 34.444444444444444444444444444 Celsius. 3항 연산자: 조건 연산자 - 요즘은 조건문이 아니라 조건"식"에 가까운 형태로 사용되고 있다. - 조건이 참이면, 앞 문장 수행(0이 출력) / 거짓이면, 뒷 문장 수행(1이 출력) //조건연산자: if ~ else문의 단축 표현 var resul..