using System;
namespace Example26
{
///
/// Summary description for Class1.
///
class Class1
{
public static int GCD(int m, int n)
{
int r;
while (n != 0)
{
r = m % n;
m = n;
n = r;
}
return m;
}
///
/// The main entry point for the application.
///
[STAThread]
static void Main(string[] args)
{
Console.WriteLine("Enter 2 integers one per line:");
int x = int.Parse(Console.ReadLine());
int y = int.Parse(Console.ReadLine());
Console.WriteLine("x= {0}, y = {1} GCD({0},{1})={2}",
x, y, GCD(x,y));
}
}
}