consider the following power function how many multiplications are executed as a result of the call power (5.0,3)? (exclude divisions in this total)
double power (double base , unsigned int exponent)
{
if (exponent == 0)
return 1.0;
else
if (even(exponent))
return power (base * base ,exponent);
else return power(base*base,exponent/2)*base;
}
A. 4
B. 9
C. 6
D. 8
Solution(By Examveda Team)
this program give error as even function is not define.Join The Discussion
Comments ( 1 )
Related User Ask Questions
Which of the following is not a primary function of a Bank?
A. Granting Loans
B. Collecting Cheques/Drafts customers
C. Facilitating import of goods
D. Issuing Bank Drafts
A. Regulatory jurisdictional fight between SEBI and IRDA
B. They don’t offer better tax benefits
C. They offer lesser returns compared to traditional insurance policies
D. All of the above
The Chameli Devi Jain Award is given for an outstanding woman ____?
A. Scientist
B. Reporter
C. Player
D. Teacher
4