how many types we can swap values of two variables without using third variable?
Just going the logic - Assume you have two variable a and b and you want to swap the value of a and b then try the following logic -
a=a+b; b=a-b; a=a-b;
Dry run assume a=5 and b =10 a=a+b means a=15 b=10 b=a-b means a=15 b=5 a=a-b means a=10 b=5
How can I wwap value two variables without using third variable or +/- operator?
a and b are compared against the threshold ‘TH’, and the nearest value is voted as output