Phone number | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Phone number

Hi , i need user to enter only 10 digits (no letters) as phone number . i know that i should do if statement and inside it for loop to check from 0 to 9 ,but i cant do it correctly

14th Dec 2017, 12:16 PM
Ady Jeko
Ady Jeko - avatar
12 Answers
14th Dec 2017, 12:51 PM
David Akhihiero
David Akhihiero - avatar
+ 9
Thanks @Gordie
15th Dec 2017, 10:37 AM
David Akhihiero
David Akhihiero - avatar
+ 7
Take the Input as integer and then convert it into string and check the length, if it's ten then convert it into integer and you're done. Code ? I don't know Java.
14th Dec 2017, 12:24 PM
Ekansh
+ 1
thx yerucham
14th Dec 2017, 12:55 PM
Ady Jeko
Ady Jeko - avatar
0
thx but i need it as code
14th Dec 2017, 12:36 PM
Ady Jeko
Ady Jeko - avatar
0
java
14th Dec 2017, 12:46 PM
Ady Jeko
Ady Jeko - avatar
0
I completed html course in sololearn but certificate but not generated it shows this course is completed but why this problems occurs.
21st Jan 2020, 3:11 PM
Vishva Mendapara
Vishva Mendapara - avatar
0
13th Jun 2021, 4:17 PM
Jacqueline Clay
- 1
what language?
14th Dec 2017, 12:46 PM
Athreyan
- 1
sorry i dont know
14th Dec 2017, 12:47 PM
Athreyan
- 1
good luck
14th Dec 2017, 12:50 PM
Athreyan