Quiz time!! | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 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