using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace Methods
{
    class Examples23_25
    {
        // Listing 3-23
        public static int Divide(int x, int y, out int remainder)
        {
            remainder = x % y;
            return x / y;
        }

        public static void MethodWithOutArg()
        {
            // Listing 3-24
            int r;
            int q = Divide(10, 3, out r);

            Console.WriteLine("{0} / {1} = {2} (reszta {3})", 10, 3, q, r);
        }

        public static void CallMethodWithRefArg()
        {
            // Listing 3-25
            long x = 41;
            Interlocked.Increment(ref x);

            Console.WriteLine(x);
        }
    }
}
