I have several question.
First time on this site btw as you can probably tell.
Anyways my first question is how do i keep the program keep repeating untill the user presses a certain key like "ctl D" or something to exit.
Also any suggestion to improve the code?
for very small primes you can use the built in gcd against the factorial of 7 or if you prefer 2*3*5*7. The values become too large after a while for this trick, though. /shrug is not better, just different. At some point gcd will be more efficient, but for 4 values probably not.
Its sufficient to check sqrt(number), not number/2.
if you wanted to factor 100, 10*10 is 100, you only need to check 10 values, nothing over 11 will divide into 100 that you haven't already seen (you saw 50 when you looked at 2, you saw 25 when you looked at 4, etc). For even such a small number as 100, that is 40 iterations saved.