C Dersi: OBEB Kodu - OBEB Bulan Program Kodları..
Kod:
#include <stdio.h>
#include <conio.h>
int obeb(int number1, int number2);
int main()
{
int x, y;
int n = 5;
while (n--) {
printf("iki tamsayı giriniz : ");
scanf("%d%d", &x, &y);
printf("obeb = %d\n", obeb(x, y));
}
getch();
return 0;
}
int obeb(int number1, int number2)
{
int i;
int min = (number1 < number2) ? number1 : number2;
for (i = min; i >= 1; --i)
if (number1 % i == 0 && number2 % i == 0)
return i;
}