New course! Every coder should learn Generative AI!
Try a free lesson+ 1
How to double value without using any arithmetic operation
2 Answers
+ 7
For integers: left shift by one. Not sure about Java, but in other languages it would look like this: n << 1
+ 5
The same for Java; (2 << 1) == 4