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.
#include<stdio.h>
#include<stdlib.h>
void whatIs (int nNum)
{
int nF = 2;
while (nNum % nF != 0)
nF++;
if (nNum != nF)
{
printf("%d ", nF);
whatIs (nNum/nF);
}
else
printf("%d.", nF);
}
int main()
{
int nNum;
scanf("%d",&nNum);
whatIs(nNum);
system("pause");
}