Write the definition of a function powerTo , which receivestwo parameters. The f
ID: 3609163 • Letter: W
Question
Write the definition of a function powerTo , which receivestwo parameters. The first is a double and the second isan int . The function returns a double .If the second parameter is negative, the function returns 0.Otherwise, it returns the value of the first parameter raised tothe power of the second.
Instructor's notes: You cannot use the pow() function since you areessentially writing a simpler version of the pow() function. Also,don't forget to take into account when the second parameter ispassed the value 0.