#include<iostream>
using namespace std;
int anik(int n, int m)
{
if(m == 0)
{
return n;
}
else
{
return anik(m, n%m);
}
}
int main()
{
int a, b;
cout << "Enter Two Number :: ";
cin >> a >> b;
cout << endl;
if(a < b)
swap(a, b);
cout << "GCD is :: " << anik(a, b) << endl;
return 0;
}
using namespace std;
int anik(int n, int m)
{
if(m == 0)
{
return n;
}
else
{
return anik(m, n%m);
}
}
int main()
{
int a, b;
cout << "Enter Two Number :: ";
cin >> a >> b;
cout << endl;
if(a < b)
swap(a, b);
cout << "GCD is :: " << anik(a, b) << endl;
return 0;
}
Comments
Post a Comment