Program for GCD


Program for GCD
#include<stdio.h>
#include<conio.h>
main()
{
int m,n,r;
clrscr();
printf("enter the m,n value");
scanf("%d%d",&m,&n);
while(n!=0)
{
r=m%n;
m=n;
n=r;
}
printf("GCD of given no Is%d",m);
getch();
}

No comments:

Post a Comment