Advertisement
Guest User

C OBEB

a guest
Aug 20th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.40 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int obeb(int, int);
  4.  
  5. int main()
  6. {
  7.     int sayi1;
  8.     printf("1. Sayiyi Giriniz: ");
  9.     scanf("%d",&sayi1);
  10.    
  11.     int sayi2;
  12.     printf("2. Sayiyi Giriniz: ");
  13.     scanf("%d",&sayi2);
  14.    
  15.     int sonuc = obeb(sayi1, sayi2);
  16.    
  17.     printf("obeb(%d,%d) = %d\n", sayi1, sayi2, sonuc);
  18.    
  19.     return 0;
  20.    
  21. }
  22.  
  23. int obeb(int x, int y) {
  24.     if (y == 0)
  25.         return x;
  26.     return obeb(y, x % y);
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement