Java Program to divide number without using division, modulus operator || Java Interview Program

preview_player
Показать описание
Hello, friends in this video I have discussed how to divide numbers without using the division operator and modulus operator.
or you can add two more lines after while loop
if(a%2==1)
result--;

if you have any doubt let me know through comment.

Give your valuable feedback through comments

Рекомендации по теме
Комментарии
Автор

I have updated the code of this program, Please check the updated code here

InterviewPoint
Автор

There is another important approach for this problem using bits manipulation.. that was what I was looking for

surajsongire
Автор

Im new to Java. Could you explain the result++ part if you dont mind please? Thanks for the video btw!

serhanalpaydin
Автор

Can u explain the same using for loop?

ZestY_YT
Автор

What about odd number ? It is work for only even number.

vaishnavirasal