163k views
5 votes
Arrange the code so that the numbers are swapped.

Second part

savec

First part

C=D

Third part

D= save

User LLuz
by
4.8k points

1 Answer

6 votes

Answer:

Following are the correct code for swapping:

save=C

C=D

D=save

Step-by-step explanation:

Please find the attached file of the program with output.

In the above, we let that the three integer variable "save, C, and D" is declared that in which the variable "C and D" holds a value and "save" variable is used to hold "C" variable value.

At this the "C" variable is empty. so, it holds a "D" variable value and when it is empty it holds a save value. At this, we perform the swapping.

Arrange the code so that the numbers are swapped. Second part savec First part C=D-example-1
User Ray Foss
by
5.0k points