GCD in C++

GCD in C++ (Greatest Common Divisor, also referred to as HCF or Highest Common Factor) is one of the most fundamental number-theoretic primitives in computer science, powering everything from rational number arithmetic and graphics rasterization to high performance cryptography (such as RSA public-key encryption and Diffie-Hellman key exchanges). The Greatest Common Divisor of two non-zero …