Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GCD of N numbers #7

Open
sandeep-vaas opened this issue Oct 30, 2017 · 1 comment
Open

GCD of N numbers #7

sandeep-vaas opened this issue Oct 30, 2017 · 1 comment

Comments

@sandeep-vaas
Copy link
Owner

No description provided.

@sitikanthamallik
Copy link

#include
using namespace std;

int main()
{
int n1, n2;

cout << "Enter two numbers: ";
cin >> n1 >> n2;

while(n1 != n2)
{
    if(n1 > n2)
        n1 -= n2;
    else
        n2 -= n1;
}

cout << "HCF = " << n1;
return 0;

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants