main()
{
int a,b;
clrscr();
printf("\n Enter any two nos.:");
scanf("%d %d",&a,&b);
printf("\n HCF of the two nos.:%d",gcd(a,b));
getch();
}
gcd(int p,int q)
{
int r;
r=p%q;
if(r==0)
return(q);
else
gcd(q,r);
}
{
int a,b;
clrscr();
printf("\n Enter any two nos.:");
scanf("%d %d",&a,&b);
printf("\n HCF of the two nos.:%d",gcd(a,b));
getch();
}
gcd(int p,int q)
{
int r;
r=p%q;
if(r==0)
return(q);
else
gcd(q,r);
}
No comments:
Post a Comment