Very Simple Cpp code


#1

Comment body goes here.
Just use basic mathematics.
Let take example a=12,b=14;
what do we do in maths,divide large number by small number and take remainder.
The same thing is also happening here.
code is

int gcd(int a,int b)
{
if(b==0)
return a; //bcz if one number is zero then gcd is other number.
return gcd(b,a%b);
}