Practice Problems

Please read the following and run the code.

The following has the correct code to swap the values in x and y (so that x ends up with y’s initial value and y ends up with x’s initial value). Run the code to see that it works.

The following has the correct code to swap the values in x and y (so that x ends up with y’s initial value and y ends up with x’s initial value). There are also comments that explain the code. Run the code to see that it works.

The following has just the steps in English to swap the values in x and y (so that x ends up with y’s initial value and y ends up with x’s initial value),

# set the initial values of x and y

# set temp to the value of x

# set x to the value of y

# set y to the value of temp

Feedback

Q-3: Please provide feedback here. Please share any comments, problems, or suggestions.

What to do next

Click on the following link to go to the post test: Post Test

You have attempted of activities on this page