About 426,000 results
Open links in new tab
  1. C Program to Swapping Two Numbers Using Bitwise Operators

    This C program is used to swapping two numbers, using bitwise operators. Program: #include <stdio.h> int main() { int i = 65; int k = 120; printf(" value of i=%d k=%d before swapping", i, k); …

  2. Swap Two Numbers Without Using Third Variable - GeeksforGeeks

    Dec 26, 2024 · Given two variables a and y, swap two variables without using a third variable. Examples: Store the sum of a and b in a (a = a + b). Get the original value of a, that is (sum - …

  3. Java Program to Swap Two Numbers Using Bitwise Operator

    Bitwise Operator: Bitwise XOR operator is used to swap two numbers. It is represented by the symbol (^) . It compares bits of two operands and returns false or 0 if they are equal and …

  4. Swapping Numbers Using Bitwise Operator in C - Online …

    Mar 5, 2021 · Learn how to swap numbers using the bitwise operator in C programming. A detailed guide with examples and explanations.

  5. How can I swap 2 integers in C using bitwise operators and bit ...

    Mar 18, 2020 · simple way to swap 2 integers in C using bitwise operators: int main() { int i, k; scanf("%d%d", &i, &k); printf(" value of i=%d k=%d before swapping", i, k); i = i ^ k; k = i ^ k; i = …

  6. C program to swap two numbers using bitwise operator

    Jan 27, 2016 · Write a C program to input two numbers and swap values of both numbers using bitwise operator. Logic to swap two numbers using bitwise operator in C.

  7. C Program to Swap two Numbers using Bitwise Operators

    /* Code to swap two numbers using bitwise operator */ void swap (int * x, int * y) {* x = * x ^ * y; * y = * x ^ * y; * x = * x ^ * y;} $

  8. Write Java program to Swap two numbers using bitwise operator

    This is a Java program that demonstrates swapping two numbers using bitwise operators. The program first declares two integer variables num1 and num2, and then prompts the user to …

  9. Swap two numbers using bitwise operator in C++ - CodeSpeedy

    We are going to use a bitwise XOR operator in C++ to swap two numbers in this tutorial. Let us first have a quick look at the working of this method with an example. Suppose we have a …

  10. Java Program to Swap Two Numbers Using Bitwise XOR Operation

    Apr 20, 2023 · The bitwise XOR operator(represented by ^) compares corresponding bits of two operands and returns 1 if they are equal and 0 if they are not equal.

  11. Some results have been removed
Refresh