Computer Science, asked by rozmarliz2799, 11 months ago

Write a c++ programme to interchange the values of two variables using a third variable











Answers

Answered by shamsidra1527
0

Answer:

User is asked to enter the value of first and second number. The input values are stored in first(num1) and second(num2) variable.

Assigning the value of first variable to the third variable.

Assigning the value of second variable to the first variable.

Assigning the value of third variable to the second variable.

Explanation:

i think this may help you

thanks

Answered by priyanka795
0

Answer:

Here we will see a program to swap two numbers using a temporary third variable. The steps are as follows:

1. User is asked to enter the value of first and second number. The input values are stored in first(num1) and second(num2) variable.

2. Assigning the value of first variable to the third variable.

3. Assigning the value of second variable to the first variable.

4. Assigning the value of third variable to the second variable.

Similar questions