IvoSilva

[PROG1] Ficha 11 | Exercício 5

Jan 13th, 2012
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.29 KB | None | 0 0
  1. #include <stdio.h>
  2. int mdc(int x , int y)
  3. {
  4.     if (y == 0) return x ;
  5.     else mdc (y , x % y) ;
  6. }
  7. void main ()
  8. {
  9.     int x , y ;
  10.     printf ("Escreva dois números para descobrir o mínimo divisor comum: ") ;
  11.     scanf ("%d %d" , &x , &y) ;
  12.     printf ("MDC : %d\n" , mdc(x , y)) ;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment