9일차 메서드의 정의(11) 정수의 크기비교

Console Programming/C# Console 2019. 10. 3. 13:42

정수 2개를 매개변수로 받아 첫번째 매개변수가 두번째 매개변수보다 클경우 

">"출력하고 

첫번째 매개변수가 두번째 매개변수보다 작을경우 

"<"

같다면 

"="

출력하는 메서드를 정의 하고 호출 하세요 

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
using System;
using Syntax24;
 
namespace Syntax24
{
    class App
    {
       
        public App()
        {
 
            Console.WriteLine("2019-09-30");
            Console.WriteLine();
 
            PrintCompareAB(57);        
        }
       
        public void PrintCompareAB(int a, int b)
        {
            if (a > b)
            {
                Console.WriteLine(">");
            }
            else if (a < b)
            {
                Console.WriteLine("<");
            }
            else
            {
                Console.WriteLine("=");
            }
        }
    }
}
http://colorscripter.com/info#e" target="_blank" style="color:#e5e5e5text-decoration:none">Colored by Color Scripter
 

 

: