0% found this document useful (0 votes)
29 views1 page

Find GCD of Given Numbers

Uploaded by

RAMSWAMI BANSODE
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views1 page

Find GCD of Given Numbers

Uploaded by

RAMSWAMI BANSODE
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

//Find GCD of given numbers:

#include<stdio.h>
int main()
{
int n1,n2,gcd;
printf("Enter tow numbers : ");
scanf("%d %d", &n1,&n2);
for(int i=1; i<=n1 && i<=n2; i++)
{
if(n1 % i == 0 && n2 % i == 0)
{
gcd =i;
}
}
printf("GCD of %d and %d is : %d\n", n1,n2,gcd);
return 0;
}

You might also like