Math, asked by TbiaSamishta, 1 year ago

minimum number of temporary variable needed to swap the contents of 2 variable is:

Answers

Answered by Sidyandex
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 mpmakawwita
0

Answer:

Step-by-step explanation:1

Similar questions