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

Energy is just like any other chemical or physical process, where it cannot be created or destroyed. Which Law states this fact? Law of Conservation of Nature L
What is the idea of blank state
Question 1. When sharing a meal. try to avoid:o fist fightso talkingO arguerents​
1) ¿Qué es la palabra poética según Liliana Bodoc?
y=2(x - 2)2 +4 powered by desmos
Which law (passed in 1976) would have prevented the wholesale destruction of the Truffula forests and mandates that every national forest draw up plans for rene
Which system controls the Endocrine System? A. Digestive B. Immune C. Excretory D. Nervous It would be lovely if you could help :) <3
2. Which source is most reliable as a source of information for a PSA about caring for animals ? A) .org websites B) a personal blog C) a school wiki site D)
Which sentence describes the bond formed between two identical atoms? O A. One atom has donated an electron to another. O B. The electrons involved in the bond
Eukaryotic chromosomes:______ a. may occur as chromatin. b. contain histones responsible for packaging DNA to fit into a small space. c. consist of both DNA