write algorithm for power of number?
Answers
Answered by
1
The most basic way to calculate the nth power of a number is to multiply that number exactly n-times. In this case, we could just find the inverse of its positive power i.e. pow(2,-3) = 1/(2^3). Declare and initialize a variable to store power say power = 1 .
Similar questions