minimum number of temporary variable needed to swap the contents of 2 variable is:
Answers
Answered by
10
A minimum number of temporary variable needed to swap the contents of 2 variable is 0.
To swap the two numbers youc an follow the following steps
n variables a, b
a=a+b;
b=a-b;
a=a-b;
or
a=a×b;
b=a÷b;
a=a÷b;
So, no temporary variables is needed
The swapping can easily be done without any other temporary variable with the above method or series.
Answered by
0
Answer:
Step-by-step explanation:1
Similar questions
English,
7 months ago
English,
7 months ago
India Languages,
7 months ago
Political Science,
1 year ago
Math,
1 year ago