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

13/8 in simplest form
Two times the number of Windows
Tracy Finely obtained a loan of $2,500 to buy a computer and a printer. The interest rate is 8.5% and the monthly payment over 24 months is $113.64. How much of
In which stage of plot does the author express the highest point of interest in the story?
Which structure will you find in a prokaryotic cell? A.nucleus B.mitochondrion C.cell membrane D.Golgi body
how do I get better grades
On which country did the war-guilt clause in the Treaty of Versailles place the blame for World War I? (5 points) Great Britain Germany Austria Hungary Russia
Which ratios form a proportion.? A)3/15,12/55 B)8/24,12/35 C)5/18,25/90 D)4/11,16/25
What is the mass of a stone moving at a speed of 15 meters/second and having a momentum of 7.5 kilogram·meters/second?
Jon ran around a track that was 1/8 of a mile of a mile long. He ran around the track 24 times. How many miles did he run?