Multiple choice

Write the steps to interchange the variable values using least memory usages. Given that - int i, j;

  1. swap(i,j);

  2. i=j; j=i;

  3. i = i + j ;j = i - j ;i = i - j ;

  4. j = i - j;i = i + j ;i = i + j ;

  5. int temp;temp=i;i = j;j = temp;

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

These are  correct steps  used to interchange the values from one variable to other without using any other variable.