1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Hitman42 [59]
3 years ago
15

Recursive Power Function Write a function that uses recursion to raise a number to a power. The function should accept two argum

ents: the number to be raised and the exponent. Assume that the exponent is a nonnegative integer. Demonstrate the function in a program.
Computers and Technology
1 answer:
Firlakuza [10]3 years ago
4 0

Answer:

// here is code in c++.

#include <bits/stdc++.h>

using namespace std;

// recursive function to calculate power of number

int cal_pow( int b_num, int e_num )

{

  if ( e_num > 1 )

      return b_num * cal_pow( b_num, e_num - 1 );

  else

      return b_num;

}

int main()

{

   // variables to store inputs

  int b_num, e_num;

  cout <<"Enter the base (int): ";

  //read the base

  cin >> b_num;

  cout << "Enter the exponent (int): ";

  // read the exponent

  cin >> e_num;

// call the function and print the output.

  cout << b_num << " to the " << e_num << " power is: "

      << cal_pow( b_num, e_num ) << endl;

  return 0;

}

//

Explanation:

Read value of base and exponent from user. Call the function cal_pow() with parameter base and exponent. In this function, it will call itself and multiply base value while exponent becomes 1.When exponent becomes 1 then base value will be return by the recursive function. In the last recursive call it will give the base to power exponent

Output:

Enter the base (int): 3                                                                                                    

Enter the exponent (int): 5                                                                                                

3 to the 5 power is: 243

You might be interested in
Find examples of conic sections in art and architecture. Visit Web sites to find pictures of artwork or buildings that illustrat
liubo4ka [24]

The question above wants to assess your interpretation of conic shapes and sections in art and architecture. For that reason, I can't write an answer for you, but I'll show you how to write it.

The conical sections can be seen in structures that assume one of the shapes considered conical. These formats are easy to identify, especially in architecture, where they are very popular. These shapes can be classified as Parabola, Circle, Ellipse, and Hyperbole

In this case, to write your answer, you should search for architectural works or works of art that present one of these types of conic sections and show how the use of this format is important for these works.

Some examples of works that use conic sections are:

  • Parabola: Eiffel Tower.
  • Circle: Farmer's Cottage Deluxe Summer House
  • Ellipse: Tycho Brahe Planetarium.
  • Hyperbole: McDonnell Planetarium

More information:

brainly.com/question/2285436

8 0
3 years ago
What is the management part of a dashboard?
Stolb23 [73]

Answer:

 The management dashboard is the visual and display the KPI ( Key performance indicator) and metrics for monitoring the specific process and department.

It is basically used for checking whether the organization achieve or meet its specific goals not as per the requirement of the particular department in the organization.

The main part of the management dashboard is that it provide the visibility and alignment in the particular organization so that it meets according to the requirements of the organization. The basic requirement in the organization are:

  • Business user
  • Organization needs
  • Information technology (IT) needs

7 0
3 years ago
The prepaid tuition plan covers
rusak2 [61]
Hey there!

A prepaid tuition plan is a plan that allows you to pay the current rate of tuition now (say, years in advance), even if it's much higher than the time when the payment for tuition would actually be paid. This plan is great for anyone who wants to pay a lower price for high–cost education now (even if their kid isn't college age yet) and not have to worry about economic standing or inflation in the future that could drive the tuition prices up. 

The plan only covers tuition and other similar fees. You can not purchase books or room and board with it in advance. So, your answer should be: C. Tuition and Fees. 

Hope this helped you out! :-)
8 0
4 years ago
Read 2 more answers
Tim is in charge of the upcoming interschool baketball tournamnent. He wants to arrange all of the teams and their members in al
zalisa [80]
I think the answer is C.
7 0
3 years ago
A blue line, called a ____ line, that appears when you are dragging a GUI object on a Windows Form object indicates that the obj
ser-zykov [4K]

Answer:

snap

Explanation:

The line which appears when we are dragging an object of GUI on a object of  windows Form indicates that the object that is being dragged is aligned horizontally with the object which is connected by the blue line is called a snap line.

Hence we conclude that the answer to this question is snap line.

3 0
3 years ago
Other questions:
  • What is the maximum number of communication paths for a team of twenty people?
    5·1 answer
  • Which of these networks is primarily for posting and viewing photos?
    8·2 answers
  • PLEASE PLEASE PLEASE PLEASE PLEASE HELP! I'M BEGGING Y'ALL! I NEED THIS FOR TODAY! CORRECT ANSWERS WILL BE AWARDED BRAINLIEST!
    6·1 answer
  • A network administrator recently implemented two caching proxy servers on the network. how can the administrator best aggregate
    5·1 answer
  • What is the first computer ever made?????
    9·2 answers
  • How is counting in this circle and square system similar to how we count in our regular lives? How is it different?
    15·1 answer
  • What is the binary system?
    13·2 answers
  • I need help. I wanna help a friend by giving him my powerpoint but I dont want him to steal my work. Is their anyway to restrict
    8·1 answer
  • Write a program that first reads in the name of an input file and then reads the input file using the file.readlines() method. T
    11·1 answer
  • Question 1 (1 point)
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!