//Find GCD of three numbers
#include<iostream.h>
#include<conio.h>
void main()
{
int a,b,c,i,j,m;
cout<<"Enter the values";
cin>>a>>b>>c;
if(a>b)
{
if(a>c)
{
m=a;
}
else
{
m=c;
}
}
else
{
if(b>c)
{
m=b;
}
else
{
m=c;
}
}
j=0;
for(i=m;i>=2;i--)
{
if(a%i==0 && b%i==0 && c%i==0)
{
j++;
break;
}
}
if(j==0)
cout<<"GCD is 1";
else
cout<<"GCD is"<<i;
getch();
}
whats wrong in this code?? My teacher says logic I have used is wrong