Define a recursive function named powerRaiser that returns the value of its type integer parameter base, raised to the power of its integer parameter power. The function assumes that power is a positive integer. Hint: 2 1 = 2 2 3 = 2 *2 2
What will be an ideal response?
```
int powerRaiser( int base, int power )
{
int ans;
if (power == 1)
ans = base;
else
ans = base * powerRaiser( base, power - 1);
return ans;
}
```
Computer Science & Information Technology
You might also like to view...
Which search will return the 15 least common field values for the dest_ip field?
A. sourcetype=firewall | rare num=15 dest_ip B. sourcetype=firewall | rare last=15 dest_ip C. sourcetype=firewall | rare count=15 dest_ip D. sourcetype=firewall | rare limit=15 dest_ip
Computer Science & Information Technology
The type of access granted to an object and the actions that you can take on or with the object are examples of what?
A. Permissions B. Rights C. Privileges D. Roles
Computer Science & Information Technology