How to Swap two numbers without a Temp variable?

How to swap two numbers without a temp variable.

We can swap like below

void main() {
 int a=6;
  int b=9;

void swap(a,b)
  print("Before swap : a=$a and b=$b");
  print("After swap : a=$a and b=$b");



This will print output like below

Before swap: a=6 and b=9

After swap: a=9 and b=6




Flutter Questions
Android Questions