gcd recursion c++
int gcd(int a, int b){
if(b==0)
return a;
return gcd(b, a % b);
}
gcd recursion c++
int gcd(int a, int b){
if(b==0)
return a;
return gcd(b, a % b);
}
greatest common denominator recursion c++
#include <iostream>
using namespace std;
int gcd(int a, int b) {
if (b == 0)
return a;
return gcd(b, a % b);
}
int main() {
int a , b;
cout<<"Enter the values of a and b: "<<endl;
cin>>a>>b;
cout<<"GCD of "<< a <<" and "<< b <<" is "<< gcd(a, b);
return 0;
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us