0

Write a code to find number of 1's between 1 to 100

14th Sep 2017, 2:55 AM
Chandra Shekhar Kumar
Chandra Shekhar Kumar - avatar
3 Answers
+ 3
I'm not sure I get the question, but here's a lame way to it :) https://code.sololearn.com/cYO2dM848ukw/?ref=app
14th Sep 2017, 7:52 AM
Ipang
+ 2
1 + 18 + 1 (18 : 10~19 -> 10 + 21,31,41,51,61,71,81,91 It is simple mathematics in a constant range, no need for a program ^^ If it where in an unknown range, then it would become interesting
14th Sep 2017, 6:34 AM
Baptiste E. Prunier
Baptiste E. Prunier - avatar