CSharp examples for System:Math Geometry
get Greatest Common Divisor
using System.Threading.Tasks; using System.Text; using System.Linq; using System.Collections.Generic; using System;// w w w.ja va 2s .c o m public class Main{ public static int getGreatestCommonDivisor(int numberA,int numberB) { int result = 1; if (numberA > numberB) result = gcd(numberA, numberB); else { result = gcd(numberB, numberA); } return result; } }