transitory
2013-04-30 04:46:38 UTC
What is the smallest positive number that is evenly divisible(giving remainder as zero) by all of the numbers from 1 to 10?
I did it for 1-10 first,
My program:
#include
int main()
{ int i,l=0,q=0;
int remz(int w,int x);
printf("answers:\n");
for(i=11;1!=l;i++)
l=remz(i,q);
}
int remz(int w,int x)
{ int m=1;
if(w%m==0)
{if(m<11)
{m=m+1;
remz(w,x);}
else
{printf("%d,",w);
x=x+1; return x;} }
}
It's showing a "segmentation fault: 11"
Can you figure out what's wrong?