class ev
{
int c=0;
long lcm(long d,int dd)
{
long div=d;
for(int i=1;i<=dd;i++) // finds the smallest divisible number between 1 to 10
{
if(div%i==0)
{
c=c+1; //counts the number of times the d variable gets divisible and sum them
}
}
if(c==dd) // if sum comes out to be 10 then we know the d variable is completely divisible by every number from 1 to 10
{
return div;// return the number
}
else
{
++div; // increment the number
c=0; // reset

Hey! We 've verified this expert answer for you, click below to unlock the details :)

I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!

Hi! What's your point?

Looking for something else?

Not the answer you are looking for? Search for more explanations.

## More answers

Looking for something else?

Not the answer you are looking for? Search for more explanations.