Stack Exchange network consists of 177 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
C, 31 bytes
while(x^=y^=x^=y%=x); return y;
just define a function for example with two intger inputs x and y:
inline int gcd(int x, int y);