Given two numbers, find sum of them without using arithmetic operators.
Explanation:
Lets assume we have two numbers "a" & "b". In while loop, repeatedly increment the number "a" and subtract number "b" until it becomes zero.
Java program to find sum of two numbers without using arithmetic operators:
Java program to find sum of two numbers without using arithmetic operators:
Output:
Enter two numbers : 4 5
Sum is : 9
Enter two numbers : 6 8
Sum is : 14
Output:
Enter two numbers : 4 5Sum is : 9
Enter two numbers : 6 8
Sum is : 14