Integer division without using the / or * operator

后端 未结 7 472
梦如初夏
梦如初夏 2021-01-14 15:34

I am going through an algorithms and datastructures textbook and came accross this question:

1-28. Write a function to perform integer division withou

7条回答
  •  孤街浪徒
    2021-01-14 16:09

    The pseudo code:

    count = 0
    while (dividend >= divisor) 
        dividend -= divisor
        count++
    //Get count, your answer
    

提交回复
热议问题