/* 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));
}
Showing posts with label GCD. Show all posts
Showing posts with label GCD. Show all posts
Sunday, February 27, 2011
GCD
Data structure
Labels:
All Programme,
bisection-method,
Data Structure,
Doubly,
DS,
GCD,
new,
postfix,
recursive,
STAARRAY,
STAKLINK,
tower
Subscribe to:
Posts (Atom)