EXAMPLE OF AN ALGORITHM

Algorithm GCD-Euclid (m, n) 

{This algorithm computes the greatest common divisor of two given positive
integers}
begin {of algorithm}
while n ≠ 0 do
begin {of while loop}
r ← m mod n;
{a new variable is used to store the remainder which is obtained by dividing
m by n, with 0≤ r < m}

m ←n;
{the value of n is assigned as new value of m; but at this stage value of n
remains unchanged}
m← r;
{the value of r becomes the new value of n and the value of r remains
unchanged}
end {of while loop}
return (n).
end; {of algorithm}

Beautiful love Massage for Your Love One
Richard Cory EA Robinson
La violencia sexual en el vecindario daña la salud mental en las mujeres

 

You may also like...

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

error: Content is protected !!