You might also see if you can improve further upon that. Everything you find that input % factor == 0, you can get two factors. factor is the obvious one, but input / factor is also one.
Uses less than sqrt(input) iterations, but the factors are out of order. (But it should be easy to order, if you know how many there are: they go smallest, biggest, 2nd-smallest, 2nd-biggest, etc, working towards a middle.)
long factor, endfact, input, factor2;
puts("Enter a number:");
puts("The factors are:");
printf("1\n%ld\n", input); // 1, input are always factors.
for(factor = 2, endfact = sqrt(input); factor <= endfact; ++factor)
if(input % factor == 0)
factor2 = input / factor;
if(factor2 != factor)