internal class Program
{
static void Divide(int a, int b, out int quotiet, out int remainder)
{
quotiet = a/b;
remainder = a % b;
}
public static void Main(string[] args)
{
int a = 20;
int b = 3;
int c;
Divide(a, b, out c, out int d);
Console.WriteLine("a:{0}, b:{1}, a/b:{2}, a%b:{3}",a,b,c,d);
// a:20, b:3, a/b:6, a%b:2
}
}
'c#' 카테고리의 다른 글
인덱서 (0) | 2021.04.16 |
---|---|
c# Auto properties (0) | 2021.04.15 |
가변길이 매개변수 params (0) | 2021.04.14 |
c# ref return (0) | 2021.04.13 |
C# call by value, call by reference (0) | 2021.04.13 |