Power program in C++