// Collection of code snippets by Arne Vajhøj // (from articles on eksperten.dk / vajhoej.dk written sometime between 2004 and now) using System; namespace ReqProp9 { public class Quotient { public int P { get; init; } public int Q { get; init; } public override string ToString() { return string.Format("{0} / {1} = {2}", P, Q, P * 1.0 / Q); } } public class Program { public static void Main(string[] args) { Console.WriteLine(new Quotient { P = 2, Q = 3 }); Console.WriteLine(new Quotient { P = 2 }); } } }