#include<stdio.h>

main()
{
 int a,b,c,ekok,buyuksay;
 printf("ilk sayi=");
 scanf("%d",&a);
 printf("ikinci sayi=");
 scanf("%d",&b);
 ekok=1;
 c=2;
 if(a<b) buyuksay=b;
 else buyuksay=a;
 while(c<=buyuksay){
 while((a%c==0)&&(b%c==0))
 {
 a=a/c;
 b=b/c;
 ekok=ekok*c;
 }

 while(a%c==0)
 {
 a=a/c;
 ekok=ekok*c;
 }
 while(b%c==0)
 {
 b=b%c;
 ekok=ekok*c;
 }

 c++;
 }

 printf("%d",ekok);
getchar();
getchar();
 
}

 

Yorum yapın
  • Misafir - James

    Unfortunately, this program does not work. HAHA, good job bud.:):):):)

    0 Beğen