OLiSwEll

Sharing is My Style

Search This Blog

GCD

/* 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));
}

0 comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...

Subscribe via email

Enter your email address:

Delivered by FeedBurner

Followers

Infolinks In Text Ads


Bloggers - Meet Millions of Bloggers

Traker

eXTReMe Tracker

online

PageRank Entertainment
Mobilt Bredband Guiden Submit Blog & RSS Feeds