Answers for "maximo comun divisir"

C
3

maximo comun divisor

int mcd(int a, int b){
	if(a == b){
		return a;
	}
	else{
		if(a > b){
			return mcd(a - b, b);
		}
		else{
			return mcd(a, b - a);
		}
	}
}
Posted by: Guest on July-09-2020
1

maximo comun divisor

// calcula el maximo comun divisor
	int mcd(int a, int b){
    int max;

    if(b == 0){
      max = a;
    }else{
      max = mcd(b, a % b);
    }

    return max;
	}
Posted by: Guest on June-28-2020

Code answers related to "C"

Browse Popular Code Answers by Language