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
Ann wants to download Adobe Acrobat software from the Internet. Prior to downloading, a standardized online contract appears on
IceJOKER [234]
Answer: terms and services
5 0
3 years ago
In symmetric encryption the same key is used to encrypt and decrypt a message. in asymmetric encryption different keys are used
Brrunno [24]

A useful advantage of Asymmetric encryption over symmetric encryption is that there is no secret channel necessary for the exchange of the public key, unlike in the symmetric encryption which requires a secret channel to send the secret key.  

Another advantage of Asymmetric encryption is that is has increased security. Asymmetric uses two different keys (Public and private) for both encryption and decryption of data while symmetric uses one.

5 0
3 years ago
Read 2 more answers
3.1.14 Wormhole CodeHS <br><br> May I have it in a copy and paste, please?
Sauron [17]

Answer:

3.1.14 Wormhole CodeHS

Explanation:

3.1.14 Wormhole CodeHS

6 0
2 years ago
Expand and simplify the following expressions. 1/2 [ 2x + 2 ( x - 3)] *​
Lerok [7]

Answer: 2

x

−

3

Explanation:

4 0
3 years ago
In a linked chain implementation of a stack ADT the performance of popping am emtry from the stack is
Mice21 [21]

Answer:

B.O(1)

Explanation:

When we are implementing ADT stack using linked chain we can pop an entry from the stack having O(1) time complexity because in linked chain we have the head or top pointer in linked chain only.Popping and pushing in stack happens on only one end that is top.So we have move to move top in linked chain to the next and delete prev node.

8 0
3 years ago
Other questions:
  • Jason works as a financial investment advisor. He collects financial data from clients, processes the data online to calculate t
    9·1 answer
  • Do routers have ip addresses? if so, how many?
    10·1 answer
  • Using Word, Maureen is writing an outline of a presentation she plans to give to her company. She will be showing a video during
    12·2 answers
  • What do you do to add a line or circle to your presentation?
    7·2 answers
  • Help!!!! ASAP TIMED TEST 50 points!!!!
    7·1 answer
  • One gigabyte can be expressed as: a.) 1,000 kilobytes b.) 1,000 bytes c.) 80,000 kilobytes d.) 1,000 megabytes e.) 8,000 bits
    5·1 answer
  • Now tell me how be rich like Bill Gates
    6·1 answer
  • Cuantos MB son 8,192 kb?​
    13·1 answer
  • A hacker using information gathered from sniffing network traffic uses your banking credentials from a recent transaction to cre
    6·1 answer
  • Which three options below describe typographic hierarchy?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!