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
V125BC [204]
3 years ago
13

Write an efficient C++ function that takes any integer value i and returns 2^i ,as a long value. Your function should not multip

ly 2 by itself i times; there are much faster ways of computing 2^i.
Computers and Technology
1 answer:
Ilya [14]3 years ago
4 0

Answer:

long power(int i)

{

   return pow(2,i);

}

Explanation:

The above written function is in C++.It does not uses loop.It's return type is long.It uses the function pow that is present in the math library of the c++.It takes two arguments return the result as first argument raised to the power of second.

for ex:-

pow(3,2);

It means 3^2 and it will return 9.

You might be interested in
This is your code.
Tju [1.3M]

Answer:

dog

Explanation:

Given the code :

>>> A = [21, 'dog', 'red']

>>> B = [35, 'cat', 'blue')

>>> C = [12, 'fish', 'green']

>>> E = [A, B, C]

the value of E[0][1]

Here, square boxes is used to select the value at E[0] ; the output is then used to select the value at index 1 of E[0] output.

Note that, indexing starts at 0; hence first list element is 0, then, 1, 2, and so on.

At

E[0] ; list E, index 0 (first element in the list) , gives an output A

Then, A[1] ; list A, index 1 (second element in the list) gives 'dog'

4 0
3 years ago
why isn't the i'm done button coming up? I can't look at the answers because it won't come up. How do I fix this without buying
Brilliant_brown [7]

Answer:

Refresh the page or x out the page and come back in completely or restart your whole laptop/desktop/tablet/phone whatever device your using

Explanation:

it will restart the page to its original state. causing the glitching out to stop.

6 0
2 years ago
Read 2 more answers
How do you see everyone on a schoology conference
Vikentia [17]
I don’t think you can
6 0
2 years ago
2. Identify two real-world examples of problems whose solutions do not scale well.
DiKsa [7]

Answer:

The specification is defined downwards according to the conclusions reached.

Explanation:

Real-world instances or examples of issues that do not scale well are listed following table:

  • For different uses, such as solving the equation, respectively., multiplication matrices.
  • It still does not scales or works well to organize a wide sequence of names or numbers as the requisite measures raise as squares by around the enlargement or increment.
7 0
2 years ago
Exchange uses an exchange database and is based on the _______________________, which uses several files in different combinatio
seraphim [82]

Answer:

The answer is 21

Explanation:

because batman is in the endgame

5 0
3 years ago
Other questions:
  • The term ________ refers to the use of a single unifying device that handles media, internet, entertainment, and telephone needs
    13·1 answer
  • Are self driving cars essential for the future of transportation
    10·1 answer
  • Nuclear batteries use devices called thermocouples, which convert the ____ of a nuclear reaction into electricity.
    9·1 answer
  • You have been tasked with ensuring that access to certain server managed resources is only available to client devices with TPM
    14·1 answer
  • How do you set up nordvpn with spectrum?
    13·1 answer
  • Which of these appliances can be classified as a robot? You can choose 2.
    15·2 answers
  • g Assignment 8: Driving costs Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon as input, a
    5·1 answer
  • What kind of eolr would you need to not have a open trouble on the facp
    12·1 answer
  • What do macOS and Windows use to prevent us from accidentally deleting files?
    15·1 answer
  • There are numerous strict and steadfast rules when it comes to composition.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!