0% found this document useful (0 votes)
29 views1 page

GCD

GCD

Uploaded by

PallaviMS
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views1 page

GCD

GCD

Uploaded by

PallaviMS
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

using

using
using
using

System;
System.Collections.Generic;
System.Linq;
System.Text;

namespace CS2026
{
class Utils
{
public static int GCD(int a, int b)
{
if (b == 0)
{
return a;
}
else
{
return GCD(b, a % b);
}
}
}
class Program
{
static void Main(string[] args)
{
int a = int.Parse(args[0]);
int b = int.Parse(args[1]);
int gcd = Utils.GCD(a, b);
Console.WriteLine(gcd);
Console.ReadLine();
}
}
}

You might also like