Ok, I have a program that gets the factors of a LCD of a number (recursion). I need help converting it to loop statement :( . Any help will be appreciated. and please add an explanation I would really appreciate it.


void whatIs (int nNum)
int nF = 2;
while (nNum % nF != 0)
if (nNum != nF)
printf("%d ", nF);

whatIs (nNum/nF);
printf("%d.", nF);

int main()
    int nNum;

No, this something you can easily do yourself, and just involves a bit of problem solving. You NEED to develop your problem solving, or you can't program worth a darn.

Work through it by hand, and see what kind of loops you're using!

Put some sweat into it! ;) Don't look at the recursive code - don't look at any code, right now. Learn how YOU would solve for LCD, using a loop (which is very natural, btw)