This is the code for calculating the 1000th power of 2.
#include <stdio.h> int main() { double multiply = 1; int i; for(i = 1; i <= 1000; i++) { multiply *= 2; } printf("%lf\n", multiply); return 0; }
And the output on my system as well as ideone
10715086071862673209484250490600018105614048117055336074437503883703510511249361224931983788156958581275946729175531468251871452856923140435984577574698574803934567774824230985421074605062371141877954182153046474983581941267398767559165543946077062914571196477686542167660429831652624386837205668069376
which is the correct answer:
irb(main):001:0> 10715086071862673209484250490600018105614048117055336074437503883703510511249361224931983788156958581275946729175531468251871452856923140435984577574698574803934567774824230985421074605062371141877954182153046474983581941267398767559165543946077062914571196477686542167660429831652624386837205668069376 == 2 ** 1000 => true
source share