As Phil has said, they are very similar.
But ... if you aren't using the passed in value - as your example doesn't - then using
ref
is redundant and just adds extra overhead to each call. Using
out
parameters instead is more reflective of what you are actually doing.
But ... I wouldn't use either in that case: I'd either create a DivisonResult struct:
public struct DivisionResult
{
public int Remainder { get; set; }
public int Quotient { get; set; }
}
And return a new instance of that:
public static DivisionResult Remainder(int FN, int SN)
{
return new DivisionResult() { Remainder = FN % SN, Quotient = FN / SN };
}
Or I'd return a tuple:
Tuple Class (System)[
^]