Q:

Print 2^64 integer in c++

I was solving a programming problem in c++. And the problem said that The input numbers are not greater than 2^64.
How can I work with that big number in c++? I have to use subtraction with the number also.

A:

uint64_t / unsigned long long can store numbers from 0 to 2^64-1, so if you either don't have input of exactly 2^64, or special case handling for it (for example, by setting a boolean and using an alternative formula when necessary), you may get away with using uint64_t.  This will be even less promising if the values may be negative, as the magnitude of numbers int64_t can handle will be -2^63...2^63-1....
You could use [long] double or float to store the numbers - for some larger integers the values may be approximations.
You could also get a library able to handle very large numbers - e.g. "GMP" - google it if interested.

