Interview Solution

One principle problem of educating software engineers is that they will not use a new method until they believe it works and, more importantly, that they will not believe the method will work until they see it for themselves. Humphrey


Language Java | Level Intermediate | Category Interview Problems | July 24, 2015 4:52 pm


Interview Problem

Power involves two numbers with a base a and the exponent n. Example 3 pow 4 = 3 x 3 x 3 x 3 = 81.
When n is a positive integer, exponentiation corresponds to repeated multiplication of the base. The languages have a built-in function to calculate the power.
Power of 3 ^ 2 = (3 * 3) = 9.0


Power of 3^2: 9.0



Please login to add comments.