GCD Write a function which returns the GCD of N1 and N2. Print the value returned

This is my code kindly let me know where am I laging

@Legendankit
hello Ankit,
image
here base should be
if(a==0) return b;
if(b==0) return a;

also
if(b> a) then swap a,b before calling gcd(b,a%b)

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.