Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

add two numbers bitwise

public class Bitwise_Addition{
    int add(int a, int b){
        int c;
    while(b!=0){
        c=a&b;
        a=a^b;
        b=c<<1;
        }
    return a;
    }
}
Comment

PREVIOUS NEXT
Code Example
Java :: hollow pyramid star pattern in java 
Java :: how to round double to 2 decimal places java 
Java :: java input string with spaces 
Java :: get all keys from pbject javascirpt 
Java :: I/flutter (10109): {filePath: null, errorMessage: java.io.FileNotFoundException: open failed: EACCES (Permission denied), isSuccess: false} 
Java :: android canvas line thickness 
Java :: java random double between 0 and 1 
Java :: reviews button ade android studio 
Java :: json array to list in java 
Java :: java find if element of list in present in another list 
Java :: install java using cmd 
Java :: if driver.find_element_by_xpath selnium java is displayed 
Java :: java bufferedreader read all lines 
Java :: Java printf() Method using PrintWriter 
Java :: check if first character of a string is a number java 
Java :: file java class 
Java :: java map merge example 
Java :: how to check if user is logged in firebase android and then load another activity 
Java :: how to call a function in java 
Java :: java explicit array declaration 
Java :: initialize an array in java 
Java :: how to unistall java 
Java :: java vs python 
Java :: primefaces download file 
Java :: tableau de chaîne de caractère en java 
Java :: How to efficiently find the start node of a loop within a singly linked list, in Java? 
Java :: findone in spring boot 2.4.1 
Java :: java set 
Java :: Spigot coding how to send a message to player after commadn 
Java :: java check if string contains multiple words 
ADD CONTENT
Topic
Content
Source link
Name
8+2 =