+ 1

I have numbers i want to know which one of this numbers one-digit,second-digit and three digit ?!

18th Feb 2019, 2:06 PM
Bishoy Michelle
Bishoy Michelle  - avatar
2 Antworten
+ 8
Assuming you are saying that you have some numbers and you want to know which number is of how many digit... You may use the the len() function as follows print(len(input())) If you had something else in your mind.. kindly specify as the question is a bit unclear
18th Feb 2019, 2:22 PM
Frost
Frost - avatar
0
Using a function in C++ as : int FindDigits(int n ) { for(int i=1; i<7; i++) if(num<pow(i, 10)) return i ; }
19th Feb 2019, 4:23 AM
Sandeep Sood
Sandeep Sood - avatar