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;
}
}
Also in Java:
- java define custom exception
- how to declare an array in java
- how to import an arraylist in java
- add one character to string java
- pascal's triangle java 2d array
- string replace java
- java foreach map
- how to replace all of one character with nothing in java
- java long to int
- resurce leak java
- java read file from command line argument
- dates in java 8
- Building a maven EAR project and specifying the configuration of which projects to include, what is the element in the plugin configuration that contains Enterprise Java Bean Projects:
- how to create a thread local variable in java
- how do i print text in java
- Write a JAVA method that expands a given binomial (ax + by)n, where integers a, b, n are user inputs. For example, if a = 2, b = -12, n = 4 are entered the method should print or return
- java function that returns the index of the largest value in an array
- how to open a text file in java
- how to remove all special characters from a string in java
- how to check if a string is in alphabetical order in java
- how to collect objective in java
- java create folder
- processing sound android
- how to know if String is the same java