Question
reference parameters
using C++
2) (6 pts) Reference parameters: Write a function that utilizes reference parameters It should call a function you write doubla powera (double n, deubles ag, doublas cube, doubles quad, doublas fireh) of the number n raised to powers: n, n, ne, and that returns the original value of n, and also returns" the value of the number n raised to powers: n',n', nt, and n3, by overwriting the corresponding reference parameters. DO NOT use any math function(s) from any C lbraries, just multiply. DO NOT DO ANY IVO IN THE FUNCTION, just process the inputs and update the reference "outputs a nain () program that loops, asking the user to enter a number or 0 to quit. Then it calls the Also write powers 0 function, and prints out the values of all on one line, such as repeat this process until the user enters a 0, and then s "Powers af 2 are 4 816 32. It should "Goodbye" and exit. hould print
Explanation / Answer
double powers(double n, double &sq, double &cube.double &quad,double &fifth){
sq = n * n;
cube = sq*n;
quad = cube*n;
fifth = quad*n;
return n;
}