Get Email Subscription

Enter your email address:

Delivered by FeedBurner

Showing posts with label GCD Program. Show all posts
Showing posts with label GCD Program. Show all posts

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);
}
read more "Find the GCD of two positive integer."

About This Blog

Lorem Ipsum

  © Blogger templates Newspaper III by Ourblogtemplates.com 2008

Back to TOP