/* Write a Program for to find the GCD of two numbers */
int gcd(int,int)
void main()
{
int no1,no2,ans;
clrscr();
printf("Enter Integer Number : ");
scanf("%d",&no1);
printf("Enter Second Number: ");
scanf("%d",&no2);
ans = gcd(no1,no2);
printf("GCD of two Number is : %d",ans);
getch();
}
int gcd(int m,int n)
{
if(n == 0)
return m;
else
gcd(n,(m%n));
}
|
|
---|
Sunday, February 27, 2011
GCD
Labels:
DS,
GCD,
LINK LIST,
Programming Skills-II
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment