webspace hosting reseller hosting|             | blog| forum| dating| free hosting| openhost| report abuse
Internet Fax To Email - Unlimited

Unlimited Faxes, No Fees, Dedicated Phone Number

Free Website Templates
#include <stdio.h>
#include <conio.h>

int mmc(int num1, int num2){
    int result=1,aux=2;
    bool cabo=false;
    while(cabo==false){
                                if(( (num1%aux)==0) || (num2%aux)==0)
                                {
                                                  if((num1%aux)==0){
                                                  num1 = num1 / aux;
                                                  }
                                                  if((num2%aux)==0){
                                                  num2 = num2 / aux;
                                                  }
                                     result = result * aux;
                                }else{  aux++; }
                                if((num1 == 1)&&(num2 == 1)){cabo=true;}
                                }//Fim while
    return result;
}

int main(){
    int um,dois,x;
    printf("Minimo Multiplo Comum entre dois numeros\n\n");
    printf("Digite o primeiro numero\n-> ");
    scanf("%d",&um);
    printf("Digite o segundo numero\n-> ");
    scanf("%d",&dois);
    x = mmc(um,dois);
    printf("\nO M.M.C. entre %d e %d eh %d",um,dois,x); 
    getch();
    return 0;
}