S_pot

210513 C#_if else 본문

C#

210513 C#_if else

S_pot 2021. 5. 31. 13:34
 class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("숫자를 입력하세요 : ");
            int input = int.Parse(Console.ReadLine());

            if((input % 2) == 0)
            {
                Console.WriteLine("짝수");
            }    
            else
            {
                Console.WriteLine("홀수");
            }
        }
    }