I\'m writing a mixed numeral class and need a quick and easy \'greatest common divisor\' function. Can anyone give me the code or a link to the code?
For C++17 you can use std::gcd defined in header :
std::gcd
auto res = std::gcd(10, 20);