0
I was trying to make a program to calculate the mmc of two integer values, but I can’t even test my code, since no tested compiler has ever run , someone knows what might be?Follows the code:
#include <stdio.h>
#include <conio.h>
int main()
{
int x,y,aux,primo,mmc,cont=0,i;
scanf("%d%d",&x,&y);
primo=2;
mmc=1;
while(x!=1 || y!=1)
{
if(x%primo==0)
{
x=x/primo;
cont++;
}
if(y%primo==0)
{
y=y/primo;
cont++;
}
if(cont==0)
{
aux=0;
while(aux=0)
{
cont=0;
primo++;
for(i=2;i<primo;i++)
{
if(primo%i==0)
{
cont++;
}
if(cont=0)
{
aux=1;
}
else
{
primo++;
}
}
}
}
else
mmc=mmc*primo;
}
printf("MMC=%d",mmc);
return 0;
}``
I don’t understand what you’re doing here: aux=0; while(aux=0) note that in while you’re assigning 0 to the aux variable, you might want to do: while(aux==0) idem here: if(cont=0)
– anonimo