How to swap two numbers without using temp variable ? Java c c++

dopeobama

Lurker
Member
Joined
Threads
11
Posts
40
can u guys help me with this i'm new on programming numbers


"
int a = 10;
int b = 20;

System.out.println("value of a and b before swapping, a: " + a +" b: " + b);

//swapping value of two numbers without using temp variable
int a = 10;
int b = 20;

System.out.println("value of a and b before swapping, a: " + a +" b: " + b);

//swapping value of two numbers without using temp variable "
 
  • dopeobama
    Created
  • Last reply
  • 1
    Replies
  • 1K
    Views
  • 2
    Participants
  • Participants list