assign the value into a double and print it with about 10 digits after the decimal place.
its probably getting 24.999999999999999999999999999999999999999999
and integer truncating that to 24.
for simple integer powers, just use X*X. Pow is slower because it supports fractional powers like x to the pi power, and for the same reasons it is internally more complex than just X*X and the algorithm it uses can have roundoff.
Those kind of errors occur sometime using pow(), that's why it's important to stay focused using it and don't make mistakes.
If you find those kind of errors to troubling for you, you can try using some programs to help you with it. I tend to use checkmarx but there are many you can use.
Good luck with it!
Ben.