C Program to find gcd of two numbers
#include
#include
int gcd(int m,int n)
{
int r;
while((r=m%n)!=0)
{
m=n;
n=r;
}
return n;
}
void main()
{
int a,b;
clrscr();
printf("\nEnter the two numbers:");
scanf("%d%d",&a,&b);
printf("\nGCD of two numbers is: %d",gcd(a,b));
getch();
}
***********OUTPUT****************
Enter the two numbers:
12
6
GCD of two numbers is: 6
Shopping In MUMBAI
Are you searching for Discounts, offers, sale in Mumbai ? You are in the right place. MUMBAI, a shopping haven, has no dearth of great discounts and sales. This blog features the best MUMBAI shopping offers, sale, discounts and deals and bargains CURRENTLY GOING on in Mumbai plus a few free things thrown in on top.
Don't wait for it because once they are gone, they are gone. Hurry!..By clicking the "Like" button you will receive a daily update of discounts, sale, offers going on in Mumbai. LIKE IT.... SHARE IT...njoY.
Wednesday, December 31, 2008
C Program to find gcd of two numbers
Posted by ars at 12:06 PM
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment