GCD using recursion
GCD using recursion code: #include<iostream> using namespace std; int GCD(int a,int b){ if(b%a==0) return a; GCD(b%a,a); } int main() { int a,b; while(cin>>a>>b){ cout<<"GCD of "<<a<<" "<<b<<" "<<"is "<<GCD(a,b)<<endl; }return 0; }