Q:
Java Program to Swap Two Numbers Using Bitwise Operator
belongs to collection: Java Number Programs
Java Number Programs
- How to Reverse a Number in Java
- Java Program Number to Word
- Automorphic Number Program in Java
- Peterson Number in Java
- Sunny Number in Java
- Tech Number in Java
- Fascinating Number in Java
- Keith Number in Java
- Neon Number in Java
- Spy Number in Java
- ATM program Java
- Autobiographical Number in Java
- Emirp Number in Java
- Sphenic Number in Java
- Buzz Number Java
- Duck Number Java
- Evil Number Java
- ISBN Number Java
- Krishnamurthy Number Java
- Bouncy Number in Java
- Mystery Number in Java
- Smith Number in Java
- Strontio Number in Java
- Xylem and Phloem Number in Java
- nth Prime Number Java
- Java Program to Display Alternate Prime Numbers
- Java Program to Find Square Root of a Number Without sqrt Method
- Java Program to Swap Two Numbers Using Bitwise Operator
- Java Program to Find GCD of Two Numbers
- Java Program to Find Largest of Three Numbers
- Java Program to Find Smallest of Three Numbers Using Ternary Operator
- Java Program to Check if a Number is Positive or Negative
- Java Program to Check if a Given Number is Perfect Square
- Java Program to Display Even Numbers From 1 to 100
- Java Program to Display Odd Numbers From 1 to 100
- Java Program to Find Sum of Natural Numbers
SwapTwoNumbersExample1.java
Output:
Let's create a program that swap two numbers using the function.
SwapTwoNumbersExample2.java
Output:
Using Multiplication and Division
We can also swap two numbers using multiplication and division operator.
SwapTwoNumbersExample3.java
Output: