Arithmetic/Rational/C sharp: Difference between revisions

syntaxhighlight manual update
m (moved Rational Arithmetic/C sharp to Arithmetic/Rational/C sharp: moved to match other Rational Arithmetic subpages)
(syntaxhighlight manual update)
 
(2 intermediate revisions by 2 users not shown)
Line 1:
<noinclude>{{collection|Rational Arithmetic}}</noinclude>
<langsyntaxhighlight lang="csharp">using System;
 
struct Fraction : IEquatable<Fraction>, IComparable<Fraction>
Line 11:
if (num == 0)
{
denom = 01;
}
else if (denom == 0)
Line 174:
 
#endregion
}</langsyntaxhighlight>
 
Test program:
<langsyntaxhighlight lang="csharp">using System;
 
static class Program
Line 201 ⟶ 200:
}
}
}</langsyntaxhighlight>
{{out}}
 
Output:
<pre>6 is perfect
28 is perfect