1.using temporary variable method is the best as it is applicable to all
datatype.

2.using airthmatic expresion:-  problem arise if we r swap the value using
pointer and both pointer point to same location
   let  int *x and int *y both point to a=20;
   now we write a method swap
  void swap(int *x,int *y)
  {
     *x=*x+*y;  //20+20=40
     *y=*x-*y;  //40-40=0;
      *x=*x-*y;// 0-0=0
  }

In this case this method fail since x and y both point to a=20;and result
become 0;

3.same problem arise in bitwise xor opertor.

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to