Program code:
#include<stdio.h>
void main()
{
int m,n,i,g;
printf("enter the first element");
scanf("%d",&m);
printf("enter the second element");
scanf("%d",&n);
for(i=1;i<=m;i++)
{
if(m%i==0&&n%i==0)
{
g=i;
}
}
printf("%d",g);
}
No comments:
Post a Comment