The maximum number of temporary variables needed to swap the contents of the variable is?
Answers
Answered by
1
Answer:
0
we can even do swap of content of the variable without of the temporary variable.
Explanation:
Answered by
0
The maximum number of temporary variables needed to swap the contents of the variable is 0.
About variables needed to swap the contents :
- The minimal number of temporary variables necessary to swap the contents of two variables is 0.
- Swapping may be done without the need for any extra temporary variables using the aforementioned approach or series.
- Without utilizing a third variable, swap the values of the two variables, x, and y. The objective is to figure out the total from one of the two sets of data. After that, the numbers may be swapped by subtracting from the total and using the result.
Similar questions