
The Euclidean algorithm
hey guys ...
i am a new member and i want some help in a pseudocode
i was asked to write a pseudocode for the Euclidean algorithm
this was the question
" The euclidean algorithm determines the greatest common divisor (GCD) of two positive numbers by repatedly replacing the larger number with the result of subtracting the smaller one from it until the two numbers are equal"
And this is my Answer Code:
Get x,y //x,y any numbers
set gcd to 0 //gcd = Great Common divisor
if (x>0) and (y>0)
then if (xy) > 0
then while (x>y)
{ set gcd to ( gcd + (xy) )
set x to xy
}
print " the GCD" + gcd
else if (yx) > 0
then while (y>x)
{ set gcd to ( gcd + (yx) )
set y to (yx)
}
print "the GCD "+ gcd
else print " the numbers are equal"
end if
end if
else print " There is a negative number at least "
end if
Is this Code correct??
and is it not could any one tell me why it is not correct and what is the correct code ??
i'm waiting guys

Wrong forum, could someone move this?
What you wrote isn't even C/C++, it looks like BASIC.