0

# Guyz anyone can please answer how to find gcd using middle school method

2 Answers

+ 9

Which language? In general:
You define two variables for which you want to find out what the gcd is. Then use the mod operator in a loop up to the minimal value of your two variables which checks if both of your variables mod the increment is 0. Store the increment if this is true for both variables. The last stored increment is your gcd then.

+ 1

tq tashi