هذا هو كود ايجاد العامل المشترك الاكبر بين رقمين بلغة السى شارب
using System;using System.Collections.Generic;using System.Text;namespace GCD{ class Program { static int GCD(int x, int y) { if (x == y) return x; if (x > y) return (GCD(x - y, x)); else return (GCD(x, y - x)); } static void Main(string[] args) { int x = int.Parse(Console.ReadLine()); int y = int.Parse(Console.ReadLine()); int d; d = GCD(x, y); Console.WriteLine("the GCD={0}",d); Console.ReadLine(); } }}