Answers for "Java program to swap two numbers using bitwise xor operator"

0

Java program to swap two numbers using bitwise xor operator

import java.util.Scanner;public class Main {public static void main(String args[]){int m, n;Scanner s = new Scanner(System.in);System.out.print("Enter the first number");m = s.nextInt();System.out.print("Enter the second number");n = s.nextInt();m = m ^ n;n = m ^ n;m = m ^ n;System.out.println("After Swapping the number");System.out.println("First number:"+m);System.out.println("Second number:"+n);}}
Posted by: Guest on June-12-2021

Code answers related to "Java program to swap two numbers using bitwise xor operator"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language