1 of 5

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);