[SOLVED] Write the code to check whether the given input(0-9) is a numeric value or not. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

[SOLVED] Write the code to check whether the given input(0-9) is a numeric value or not.

we are not allowed to use two things. 1) int a; if((a>=0)&&(a<=9)) System.out.print("valid number"); 2) We are also not allowed to use the ASCII value . Avoiding these two things, we have to write the code.

29th Jun 2018, 8:01 PM
Gaurav Raj
Gaurav Raj - avatar
6 Answers
+ 2
isn't this just basic regex usage?
29th Jun 2018, 8:39 PM
hinanawi
hinanawi - avatar
0
hinanawi can u plz elaborate
29th Jun 2018, 9:05 PM
Gaurav Raj
Gaurav Raj - avatar
0
hinanawi Thank you . But how will i implent it in java code.
29th Jun 2018, 9:17 PM
Gaurav Raj
Gaurav Raj - avatar
0
hinanawi Thank you
29th Jun 2018, 9:34 PM
Gaurav Raj
Gaurav Raj - avatar