+ 2

DIGIT QUANTITIES

How can i make the code that will output how many digits the number I entered? For example: The input:6 The output:1 The input:82 The output:2 The input:828 The output:3 The input:8282062 The output:7 --------------------------------------- |But it must include "if,else,cin" in c++.| ---------------------------------------

12th Oct 2018, 4:17 PM
TheDoctor
TheDoctor - avatar
5 ответов
+ 4
Well, I am luring you to python!😂😂 So, don't mind. In python, it's oneliner print(len(str(input())))
12th Oct 2018, 6:27 PM
Roneel
Roneel - avatar
+ 2
Roneel 😂😂
13th Oct 2018, 3:14 AM
Madhav
Madhav - avatar
12th Oct 2018, 5:17 PM
Madhav
Madhav - avatar
0
https://code.sololearn.com/cNh2AUouzyPr/?ref=app digit quantities in java😅
13th Oct 2018, 6:11 AM
Praveen
Praveen - avatar
0
Dividing an integer with more than 1 digit by 10 will remove the rightmost digit.
13th Oct 2018, 1:03 PM
Chris
Chris - avatar