Get Email Subscription

Enter your email address:

Delivered by FeedBurner

Wednesday, March 10, 2010

Find the GCD of two positive integer.

Find the G.C.D of two positive integer.


#include<stdio.h>
#include<conio.h>
void main( )
{
int a, b;
clrscr( );
printf("Enter any two positive integer\n");
scant("%d %d", &a, &b);
while (a!=b)
{
if (a > b)
a = a - b;
else
b = b - a;
}
printf("The gcd is %d \n", a);
}

Related Posts by Categories



0 comments:

About This Blog

Lorem Ipsum

  © Blogger templates Newspaper III by Ourblogtemplates.com 2008

Back to TOP