Ok I get it now, and it now works! Thanks for the help. Should I use htis meathod of input instead of scanf for everyhting? Also, if I may ask, how would you allow it to calculate for numbers with many, many numbers? I notice after a certain number of digits it just simply returns prime. Anyway, t hankyou for the help.