GCD OF A NUMBER

# include<stdio.h>
int gcd(int,int);
void main()
{
int x,y,z;
printf("enter two numbers\n");
scanf("%d %d",&x,&y);
z=gcd(x,y);
printf("the gcd of the numbers is %d",z);
}

int gcd(int x,int y)
{
if(y>x)
return gcd(y,x);
if(x==y)
return x;
if(x%y==0)
return y;
else
return gcd(x,x-y);
}