Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

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);}}
Comment

PREVIOUS NEXT
Code Example
Java :: empty map entry java 
Java :: Java program to print the character or a letter x using star 
Java :: get method jdbc 
Java :: spring boot initializr-generator example 
Java :: actionlistener 
Java :: android java close keyboard 
Java :: location.href webview android studio 
Java :: how to extract word from string in java 
Java :: java default access modifier 
Java :: one space diagonally in java 
Java :: how to display an integer in a textfield in java 
Java :: sealed class java codegrepper 
Java :: android how to get month on world programmatically 
Java :: Java Catching base exception class only 
Java :: change button background drawable in code Close 
Java :: unique numbers in array java 
Java :: Start Text from top left android 
Java :: how to make easy animations in canva 
Java :: java hashmap get nonexistent key 
Java :: java code to create square using 2D array 
Java :: how get most comon element in map java 
Java :: Java Protected Access Modifier package two 
Java :: spigot self cancelling task 
Java :: android studio epoch to localdatetime 
Java :: how to find all apps on android device using java 
Java :: compare array with himself java 
Java :: run app by package android 
Java :: Original authors: Talmon Marco, Igor Magazinnik Programming languages: Java, C, Python, C , Qt, Objective-C 
Java :: android studio see what activity you came from 
Java :: Accept Integer only in if else statement 
ADD CONTENT
Topic
Content
Source link
Name
7+8 =