I have to find the factors of 900851475143........
In which data type do i store it?
Also if I use double, I cant use % operator to get its factors!
HELP appreciated
You do not use a double to get the factors of this number, just an integer. There is no reason to use a double here. Your compiler might support integers this big. Try:
unsignedlongint a = 900851475143;
or
unsignedlonglongint a = 900851475143;
If this does not work, then you are stuck with 32 bits, but you can use:
An unrelated tip: If you estimate the square root of the number first, you can stop the program when it reaches the square root. This will save lots of time calculating the factors. Calculating factors of very large integers can take a long time.