#include< stido.h>
#include< conio.h>
int main( )
{
int a, b, res;
clrscr( );
printf("Enter the two integer values:");
scanf("%d%d", &a, &b);
for( ; ; ) //This is empty for loop.
{
res = a%b;
if( res = = 0) break;
a = b;
b = res;
}
printf("\n The GCF is : %d", res);
getch( );
return 0;
}
Subscribe to:
Post Comments (Atom)
printf("\n The GCF is : %d", res)
ReplyDeletein the above statement we hav to make an adjustment else the o/p is always zero.
the adjustment is:
printf("\n The GCF is : %d", b)
This comment has been removed by the author.
ReplyDeleteI have just started learning computer programming. I found this website very informative. It will help me to get some good programming concepts.
ReplyDeleteFor Best C Programs with Full Explanatons..
ReplyDeleteVisit Here ►► Lightning Code
full fledged c language online training we are provieding
ReplyDeleteC Online Training