Search (Article Or Program)

18 June 2011

G.C.D program of Three Number (in C)

#include
#include
main()
{
int a,b,c,r;
scanf("%d %d %d",&a,&b,&c);
while(b!=0)
{
r=a%b;
a=b;
b=r;
}
while(c!=0)
{
r=a%c;
a=c;
c=r;
}
printf("%d\n",a);
getch();
}