Write a logic to exchanged the value of two variable. a=10,b=20
Answers
Answered by
2
nitish8089:
correction..
Answered by
2
Hi,
To exchange value of two cariables you have to make another varibale.
a = 10
b = 20
c = a // now c contains value of a which is 10
a = b // here a contains value of b which is 20
b = c // and here we are assining value of c which is 10 to variable b
so now a is equals to 20 and b is equals to 10
Similar questions
India Languages,
7 months ago
Science,
7 months ago
Accountancy,
7 months ago
English,
1 year ago
Math,
1 year ago
Physics,
1 year ago
Social Sciences,
1 year ago