Advertisement
Guest User

asd

a guest
Nov 15th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.33 KB | None | 0 0
  1. #include<stdio.h>
  2.  
  3. int MCD(int a,int b){
  4.     if(a == 0)
  5.         return b;
  6.    
  7.     return MCD(b % a,a);
  8. }
  9.  
  10.  
  11. int main()
  12. {
  13.     int a,b;
  14.     printf("Ingrese un numero ");
  15.     scanf("%i",&a);
  16.     printf("Ingrese otro numero ");
  17.     scanf("%i",&b);
  18.  
  19.     int maximoComunDivisor = MCD(a,b);
  20.     printf("El maximo comun divisisor es %i ",maximoComunDivisor);
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement