Numbers before swapping: Num1: 6 Num2: 2 Numbers after swapping: Num1: 2 Num2: 6 Explanation: Here, we created 2 integer variablesnum1,num2that are initialized with 6, 2 respectively. Then we exchanged values of both variables using the bitwise XOR (^) operator. After that, we printed...
NumPy - Binary Operators NumPy - String Functions NumPy - Matrix Library NumPy - Linear Algebra NumPy - Matplotlib NumPy - Histogram Using Matplotlib NumPy Sorting and Advanced Manipulation NumPy - Sorting Arrays NumPy - Sorting along an axis NumPy - Sorting with Fancy Indexing NumPy - Structured ...
0 - This is a modal window. No compatible source was found for this media. Kickstart YourCareer Get certified by completing the course Get Started Print Page PreviousNext Advertisements
使用按位 XOR 交换两个整数(无需额外的内存分配)Created: November-22, 2018 var a = 11, b = 22; a = a ^ b; b = a ^ b; a = a ^ b; console.log("a = " + a + "; b = " + b);// a is now 22 and b is now 1...