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
in java how do i Write a Java program that takes ten numbers as input to calculate and print the average of the numbers.
Andrei [34K]

Answer:

You could just use a code library.

Explanation:

8 0
3 years ago
The transport layer protocol used by the tcp / ip suite that does not provide guarantees on ordering or confirmation of receipt
VARVARA [1.3K]
UDP = connectionless vs. TCP is connection oriented.
4 0
3 years ago
A check list should be based on that apply to your industry.
frozen [14]
Can you please elaborate? This is as your question isn't very clear.
6 0
3 years ago
Read 2 more answers
is skill in using productivity software, such as word processors, spreadsheets, database management systems, and presentation so
Digiron [165]

Answer:

It is general knowledge

Explanation:

What you covered is general knowledge and the entrance to computer science.

4 0
3 years ago
ARP only permits address resolution to occur on a single network.could ARP send a request to a remote server in an IP datagram?w
romanna [79]

Answer:

The answer to this question is Yes it is possible

Explanation:

It can be done In the case where a special server is required in each network that would forward the request to the  remote ARP(Address Resolution Protocol) server and will receive the response from the server and send it to the requesting host.So we conclude that we can do that hence the answer is Yes.

5 0
3 years ago
Other questions:
  • A network administrator issues the show vlan brief command while troubleshooting a user support ticket. What output will be disp
    15·2 answers
  • Let's say you're creating a search stream in your hootsuite dashboard, to find mentions of the phrase vacation holiday getaway.
    15·1 answer
  • All queries have an explicit location. true of false
    13·2 answers
  • Does anyone take bca on plato
    11·1 answer
  • Convert 78 to binary
    6·2 answers
  • A company has critical systems that are hosted on an end-of-life OS. To maintain operations and mitigate potential vulnerabiliti
    14·1 answer
  • Add me on Fortnite. Epic is smashman892. *Ik it sux but it's an old account* Comment ur epic
    6·2 answers
  • Define two benefits to members of the community of replacing the printed copy with an online version.
    5·1 answer
  • 10.
    12·1 answer
  • A good algorithm should have which three components?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!