Quantcast
Channel: Implement division using only addition - Code Golf Stack Exchange
Viewing all articles
Browse latest Browse all 18

Answer by Dinesh Kumar P for Implement division using only addition

$
0
0
//a lies between 1 and 200, b lies between 1 and a.int divide(int a,int b){int x=a,y=b;int count=1;while(y<x){y+=y;count++;}return count;}

Viewing all articles
Browse latest Browse all 18

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>