#include<stdio.h>
#include<conio.h>
void main()
{
int m,i,x,y;
clrscr();
printf("Enter the two number");
scanf("%d%d",&x,&y);
if(x>y)
m=y;
else
m=x;
for(i=m;i>=1;i--)
{
if(x%i==0&&y%i==0)
{
printf("\n HCF is %d",i);
break;
}
}
getch();
}
OUTPUT-

#include<conio.h>
void main()
{
int m,i,x,y;
clrscr();
printf("Enter the two number");
scanf("%d%d",&x,&y);
if(x>y)
m=y;
else
m=x;
for(i=m;i>=1;i--)
{
if(x%i==0&&y%i==0)
{
printf("\n HCF is %d",i);
break;
}
}
getch();
}
OUTPUT-
If you are being attentive to learn several strategies then you ought to browse this article, I am certain you'll get much additional from this article.
ReplyDeletetutorial for c++