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
IgorC [24]
3 years ago
7

Don wishes to swap the values of the variables x and y in his program. He adds a line of code which sets the value of x to the v

alue of y and then a line of code which sets the value of y to the value of x. What is the effect of Don’s code?a. The values of both x and y will be set to the average of the original values of x and y.b. The values of both x and y will be set to the original value of x.c. The values of both x and y will be set to the original value of y.d. The values of the variables x and y will be swapped as intended.
Computers and Technology
1 answer:
12345 [234]3 years ago
5 0

Answer:

The correct answer is (c): The value of both x and y will be set to the original value of y.

Explanation:

Let suppose, we assign some value to variable x and to variable y i.e.

var x=10

vary y=15

Then Don adds a line of code which set the value of x to value of y i.e.

x=y

here it is mean that value of x become 15.

So after this line the value of x is 15 and y is also 15

Then he also added a line of code which set the value of y to value of x. i.e.

y=x

By adding this line of code, the value of y is 15 because x is equal to 15.

Therefore, the value of both x and y will be set to the original value of y.

Why other option are not correct

a. After swapping the value of both variable it is impossible that both variable retain original value in it.

b. this option is only true if in this first line he set the value of y to value of x and in the second line set the value of x to value of y.

d. When you swap two values, there is need of third variable for swapping, when you will swap the value only between two variable, only one variable value will be retained and intended swapping will not be performed

You might be interested in
One easy way to tell if a cell contains a formula instead of data is to click on the cell and look at the formula bar to
joja [24]

Answer:

E

Explanation:

i know

3 0
2 years ago
Read 2 more answers
Fire stick optimizing system storage and applications
vivado [14]

Answer:

IN MY PROFILE

Explanation:

I HAVE AWNSERED THIS QUESTION THROUGHOUT MY BEING HERE PLEASE DO NOT BE AFRAID TO CLICK ON MY PROFILE AND FIND THE ANSWER

5 0
2 years ago
What is MS-Word? Write some versions of MS-Word.
shtirl [24]
Ms- word it is , hope it was helpful
8 0
3 years ago
Read 2 more answers
In 5-10 sentences, describe the purposes, design considerations, and common elements of most brochures.
lozanna [386]
The primary thing to consider when designing a brochure is the target audience. <span> Brochures are meant to capture attention and deliver information, so it's important that the audience will want to read it in the first place.</span> When planning the design, consider the placement of elements and how they are arranged, or the 'white space'. Also take into consideration whether photos will be used. This ensures readability. <span>Also plan for the brochure's color scheme and fonts. These capture the audience so these are core parts of the design.</span>
4 0
3 years ago
Why do i have to wait and watch videos
Mila [183]

The reason being is because of your search history. Google will remember everything you like to watch, look, play or buy things on the computer or any device with internet. Since you are interested in the things you like to do, you're computer will remember this and will display Ads made by companies, or people, which possibly may be a scam, or may give a virus. I would advise to avoid these things as much as you can.

7 0
2 years ago
Other questions:
  • Software license infringement is also often called software __________.
    11·2 answers
  • Which of the following statements is false?
    10·1 answer
  • Can some one fix this <br> input ("Enter a number: ") <br> print (num * 8)
    9·1 answer
  • What is the Code of Conduct/Ethics for the company/of Department of Defense?
    7·1 answer
  • A(n) ______ is a type of collaborative website that allows users to create, add, modify, or delete website content.
    12·1 answer
  • Is backing up computer files done on the hard drive?
    14·2 answers
  • ___________ key encryption in wep uses the rc4 encryption algorithm.
    9·1 answer
  • Which of the following is the best definition of a computer code? a secret language a mathematical language a language that comp
    10·2 answers
  • The NVCC college professor receives frequent emails disguised as official business emails. They may be requests to reset a passw
    10·2 answers
  • Write the Flowchart to find Even number between 1 to 50<br>​
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!