the swap is basically purchasing foreign currency in the spot market and selling at forward or purchasing at forward and selling also at forward swap in purchasing in spot rate and selling at forward and swap out is the opposit of it
the swap is basically purchasing foreign currency in the spot market and selling at forward or purchasing at forward and selling also at forward swap in purchasing in spot rate and selling at forward and swap out is the opposit of it
View page
void swap (int *a, int *b) {
*a ^= *b;
*b ^= *a;
*a ^= *b;
return;
}
View page
You cannot swap two numbers using call by value, because the called function does not have access to the original copy of the numbers.
Swap with call by reference... This routine uses exclusive or swap without temporary variable.
void swap (int *a, int *b) {
*a ^= *b;
*b ^= *a;
*a ^= *b;
return;
}
View page
Use a temporary variable. Example (swap variables "a" and "b"): int a = 5; int b = 10; // Swap the variables int temp; temp = a; a = b; b = temp; System.out.println("a = " + a); System.out.println("b = " + b);
Use a temporary variable. Example (swap variables "a" and "b"): int a = 5; int b = 10; // Swap the variables int temp; temp = a; a = b; b = temp; System.out.println("a = " + a); System.out.println("b = " + b);
Use a temporary variable. Example (swap variables "a" and "b"): int a = 5; int b = 10; // Swap the variables int temp; temp = a; a = b; b = temp; System.out.println("a = " + a); System.out.println("b = " + b);
Use a temporary variable. Example (swap variables "a" and "b"): int a = 5; int b = 10; // Swap the variables int temp; temp = a; a = b; b = temp; System.out.println("a = " + a); System.out.println("b = " + b);