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 n,int d)
{
int r;
do{
r=n%d;
n=d;
d=r; }while(r!=0);
return(n);
}
{
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 n,int d)
{
int r;
do{
r=n%d;
n=d;
d=r; }while(r!=0);
return(n);
}
No comments:
Post a Comment