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
What is the name of the keyboard developed in the 1930s?
Alexandra [31]
The Dvorak Keyboard.
4 0
4 years ago
​In sql server, the cursor property ____________________ means that the cursor is used for retrieval purposes only.
enyata [817]
I have recently found this answer https://assignment.essayshark.com/blog/sql-simple-examples-database/. Then provided me with a ready assignment in a very short period of time.

5 0
3 years ago
Which of the following would be considered hardware? Select 3 options.
Vilka [71]

Answer:

CPU, printer, peripherals

Explanation:

Keep in mind hardware is parts you can add to the computer. Other examples are monitor, keyboard, mouse.

Microsoft Office and the operating system are software.

8 0
3 years ago
Click _______ to add a new column to a table.
Sophie [7]
The answer is Insert control B

5 0
4 years ago
Read 2 more answers
I want to discard my old computer and want to securely erase the data from my hard drive what is the process called.
laiz [17]
I believe the process is called High Level Format.
8 0
4 years ago
Read 2 more answers
Other questions:
  • "re-type the celsius_to_kelvin function. Change the name to kelvin_to_celsius, and modify the function accordingly."
    7·2 answers
  • The wireless spectrum, as defined by the fcc, spans between which two frequencies?​
    7·1 answer
  • White arrows in the middle of the lane indicate whether the lane must __________.
    8·2 answers
  • What are the Java counterpart to UML attributes.
    6·1 answer
  • Your corporation hosts a Web site at the static public IP address 92.110.30.123.
    13·1 answer
  • The area surrounding your car that can't be seen from the driver's seat is called
    14·2 answers
  • Which of these best represents a call to action?
    7·2 answers
  • Which of the following is the best example of an installation issue
    11·2 answers
  • An IT systems engineer creates a new Domain Name System (DNS) zone that contains pointer (PTR) resource records. Which zone type
    15·1 answer
  • How do we add questions on sam Blockly?​
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!