hmm... yes but it is buging like crazy look at this !i am using C#!
Console.WriteLine("This is a program that calculates the gcd of some typed number");
int StartingNum = Convert.ToInt16(Console.ReadLine());
int NumForCalculate = StartingNum;
string gcd = ("");
int gathering = 1;
operation:
int x = 2;
operation2:
if ((NumForCalculate / x) == :see below:)
{
if (gcd == "")
gcd = ("" + x);
else
gcd = (gcd + "," + x);
NumForCalculate = (NumForCalculate / x);
gathering = gathering * x;
if (NumForCalculate <= 1)
goto end;
else
goto operation;
}
else
{
x++;
goto operation2;
}
end:
Console.WriteLine("gcd of integers {0} is {1}, and gathering this set of numbers is {2}", StartingNum, gcd, gathering);
Console.ReadKey();
if i set 20
if ((NumForCalculate / x) == 1)
then gcd of integers 20 is 11, and gathering this set of numbers is 11
if ((NumForCalculate / x) == 0)
then gcd of integers 20 is 21, and gathering this set of numbers is 21