YarionNeethugher YarionNeethugher
  • 19-03-2017
  • Computers and Technology
contestada

Write a recursive method int power(int i, int j which determines teh result of i^j where j>=0

Respuesta :

rsmith6559
rsmith6559 rsmith6559
  • 23-03-2017
int power( int i, int j )
{
   if( j == 0 )  // base case
       return( 0 );
   return( i * power( i, j -1 ) );
}
Answer Link

Otras preguntas

Which Allied nation controlled the Suez Canal in North Africa? Great Britain Egypt Japan the United States
What can happen if a claim is not backed up by the proper reasons and evidence? * It will prove that the claim is incorrect. It will change the opinion of the p
Explain the link between water scarcity and population growth.
Southern armies had a better battle advantage than northern armies during the civil war because most of the battles took place in the south. they had more railr
What is the solution to the system of equations? y =2/3 x + 3 x = -2 0 (-2,- ) 01-25 101-2, 12 0 [-2.3)
Which would be the most effective way of organizing a website with over 1 million pages?
Hello Please Find The Answer To This Question (easy) Part 2
Select the correct answer. Historically, the earth's ocean had a pH of 8.2. In recent years, it has dropped to 8.1. How might this change affect the ocean envir
Tidal energy is powered by: A. Earth's gravity. B. the moon's gravity. C. the thermocline of the ocean.
Kylie owes $1,700 on her credit card. The bank charges a monthly interest rate of 0.925%. If Kylie wants to pay off her credit card using equal monthly payments