XeBuZer0

Programa Básico del Algoritmo de Euclides

Feb 21st, 2019 (edited)
504
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.58 KB | None | 0 0
  1. /* ** // ** // ** // ** // ** // ** // ** // ** // ** // ** // ** // ** // ** // ** // ** // ** */
  2. /* ** // ** // ** // ** // ** //  * F v q _ U k r a N a z i s ! * // ** // ** // ** // ** // ** */
  3. /* ** // ** // ** // ** // ** // ** // ** // ** // ** // ** // ** // ** // ** // ** // ** // ** */
  4.  
  5. #include <stdio.h>
  6.  
  7. int mcdRR(int a,int b){
  8.     return (a!=b)?(a>b)?mcdRR(a-b,b):mcdRR(a,b-a):a;
  9. }
  10.    
  11. void main(void){
  12.     int n1, n2;
  13.     printf("Ingrese 1er número");  scanf("%d",&n1);
  14.     printf("Ingrese 2do número");  scanf("%d",&n2);
  15.     printf("El MCD de %d y %i es %d\n",n1,n2,mcdRR(n1,n2));
  16. }
Add Comment
Please, Sign In to add comment