Issue
I'm asked to do a program that asks for two numbers, the first variable for example is 4 and the second is 5, i need the program to show the first variable as 5 and the second one as 4, so i need the variables to exchange their values
Thanks :DDDD
Solution
I think you are asking for number swapping logic.So you can use two logic to swap the number 1. By using 3rd variable. 2. Without using 3rd variable.
Their respective logic's are as follows. Suppose you have x=4,y=5; take 3rd variable like temp;
temp=x; x=y; y=temp;
and 2nd logic.
x = x+y; y=x-y; x=x-y;
Answered By - Lawakush Kurmi