+ 3

Quiz time!!

Make a program which counts the number of numeric values in a string!!! Eg: input : i am born at 9th august 1996!! output: 5 // where 9 -first number 1- second number 9-third number 9-fourth number 6- fifth number so totally 5 numbers!! //

31st May 2017, 6:16 AM
U L Knw Me soon😉😋
U L Knw Me soon😉😋 - avatar
4 Answers
31st May 2017, 6:51 AM
Burey
Burey - avatar
+ 2
@burey well that was easy to bite for you😂😂 I just created another quiz to make u chew this time😜😉 here is the link https://www.sololearn.com/discuss/433726/?ref=app
31st May 2017, 7:40 AM
U L Knw Me soon😉😋
U L Knw Me soon😉😋 - avatar
+ 2
@Michal you program is all good😉 and it s decimal actually😅
31st May 2017, 7:55 AM
U L Knw Me soon😉😋
U L Knw Me soon😉😋 - avatar
+ 1
did you mean 'decimal digits' ? https://code.sololearn.com/wIQsjcz4I4XR/#php <?php $str = 'i am born at 9th august 1996!!'; $cnt = 0; for($idx = 0; $idx < strlen($str); $idx++) if (is_numeric($str[$idx])) $cnt++; echo $cnt; ?>
31st May 2017, 7:45 AM
Michal
Michal - avatar