need some help please

I input X,Y
and x^y where x=x*x*...x (y times)
so how i can find power in C++?
If y is of type int and y > 0 you can try:

long power = 1;
for (int i=0;i<y;i++)
   power *= x;

Or more generally, you can use the built in C++ function "pow". You will have to include math.h. The documentation of this function can be found at
Topic archived. No new replies allowed.