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
Lerok [7]
3 years ago
6

The variables xp and yp have both been declared as pointers to integers, and have been assigned values. Write the code to exchan

ge the two integers
Computers and Technology
1 answer:
shepuryov [24]3 years ago
6 0
The question is asking us to swap the values of xp and yp while not changing where they point to. Setting xp equal to yp would not work because then we couldn't change yp since the value for xp was overwritten. We can use a third variable to swap them.

int zp = xp;
xp = yp;
yp= zp;
You might be interested in
The parallax perspective says that objects that are close up appear to move __________ than far away objects.
serious [3.7K]

Answer:

It appears to move faster.

5 0
3 years ago
Why does the media play such an important role in our personal freedom? Select 3 options.
Helga [31]

Answer:

It promotes self-expression

It holds the government accountable

It keeps us informed

Explanation:

I got them right Ed

7 0
2 years ago
An attacker gained remote access to a user's computer by exploiting a vulnerability in a piece of software on the device. The at
Anni [7]

"A Buffer overflow" vulnerability exploit resulted from the attacker's actions.

Whenever a software or an application writes too much data into a buffer, causing neighboring storage regions to have been corrupted as a consequence, this could be determined as Buffer overflow.

⇒ There are two kinds of Buffer overflow attacks such as:

  • <u>Stack-based</u> - It will become more popular to use such memory, as well as that's only available during implementation of any code.
  • <u>Heap-based</u> - Those attacks seem to be more difficult to execute because they entail overflowing overall storage capacity allotted for a program further than the space needed for something like the program's present activities.

Thus we can say that the correct answer is a Buffer overflow.

Learn more about Buffer overflow here:

brainly.com/question/4952591

6 0
2 years ago
A student is helping a friend with a home computer that can no longer access the Internet. Upon investigation, the student disco
Firlakuza [10]

Answer:

Option (D) is the right answer.

Explanation:

DHCP term used as a short form of dynamic host configuration protocol, which is used to assigns the IP address automatically according to the network.

According to the scenario, the system is getting the wrong IP address that resulting in internet disconnection which is a failure of the DHCP server because it is responsible for assigning the right IP address to the system.

Hence option (D) is the most appropriate answer.

While other options are wrong because of the following reasons:

  • Static IP is the type of IP address which is fix and doesn't change in the system after rebooting, hence it has no connection in the change of IP address.
  • If the DHCP server is working well there is no chance of interference from the surrounding device.
  • Network setting has no connection with computer power supply as SMPS is used to give power and boot system only.
8 0
3 years ago
Given the following function definition:
neonofarm [45]

The question is incomplete! Complete question along with its step by step answer is provided below!

Question:

Given the following function definition:

void calc (int a, int& b)

{

int c;

c = a + 2;

a = a * 3;

b = c + a;

}

x = 1;

y = 2;

z = 3;

calc(x, y);

cout << x << " " << y << " " << z << endl;

What is the output of the following code fragment that invokes calc?

a. 1 2 3

b. 1 6 3

c. 3 6 3

d. 1 14 9

e. None of these

Answer:

b. 1 6 3

Explanation:

In the given problem we have a function void calc which takes two input arguments a and b and updates its values according to following equations

c = a + 2;

a = a * 3;

b = c + a;

Then we call this function calc(x,y) by providing test values of

int x = 1;

int y = 2;

int z = 3;

and the output returns the values of x, y and z

cout << x << " " << y << " " << z << endl;

Lets find out what is happening here!

When the program runs we provide x=a=1 and y=b=2

c=a+2=1+2=3

a=a*3=1*3=3

b=c+a=3+3=6

So the updated values of a=x=3 and b=y=6?

NO!

The updated values are a=x=1 and b=y=6

WHY?

There are two ways to pass values

1. Pass by values -> value cannot change  (int a)

2. Pass by reference -> value can change (int& b)

Look at the function void calc (int a, int& b) ;

Here we are passing (int a) as a value and (int& b) as a reference, therefore x remains same x=1 and y gets changed to updated value y=6 and z remains same as z=3 since it wasnt used by function calc(x,y)

The right answer is:

b. 1 6 3

x=1, y=6, z=3

4 0
3 years ago
Other questions:
  • Need answers for 11&amp;12. Due today. Thanks.
    14·1 answer
  • Which is the common name for a program that has no useful purpose, but attempts to spread itself to other systems and often dama
    14·1 answer
  • One of the ways to create a horizontal navigation menu from an unordered list is to a. set the display property of the element w
    6·1 answer
  • Which is an advantage of programming with a procedural language?
    12·2 answers
  • Working at a ski resort in the mountains has its own unique security issues. Kenny is the chief information officer for Sundance
    10·1 answer
  • /*
    8·1 answer
  • Given the following while() loop, which statement is true assuming A,B,C,D are int variables and A &gt; B? while ( ( A &gt;= B)
    8·1 answer
  • These icons cannot be removed from the Dock. Finder e-mail music player Trash
    14·1 answer
  • 8.
    9·1 answer
  • All of the following are true about data science and big data except: a.Digital data is growing at the rate of 2.5 quintillion b
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!