C Program to find gcd of two numbers
#include<stdio .h="">
#include<conio .h="">
int gcd(int m,int n)
{
int r;
while((r=m%n)!=0)
{
m=n;
n=r;
}
return n;
}
void main()
{
int a,b;
clrscr();
printf("\nEnter the two numbers:");
scanf("%d%d",&a,&b);
printf("\nGCD of two numbers is: %d",gcd(a,b));
getch();
}
***********OUTPUT****************
Enter the two numbers:
12
6
GCD of two numbers is: 6</conio></stdio>