I want to count number of digits in O(1) And how is it possible? asked 23 Sep '17, 23:40

The question has been closed for the following reason "Issue Resolved." by vijju123 04 Oct '17, 21:21
convert the integer to String (rather take the input as String) .. length of the string is the number of digits in the NUMBER. answered 23 Sep '17, 23:46

Bro , you could easily get these things in one google search Anyway the answer is log10(n)+1 answered 04 Oct '17, 17:28

This may help https://stackoverflow.com/questions/10723295/countingnumberofdigitsinanumberino1 More over you can do this while taking input simultaneously when using fast input methods like getchar() . answered 23 Sep '17, 23:48
