+ 7
challenge-- length of random number
var randm = Math.floor(Math.random()*100)+1; o/p : numbers between 1 &100; i wanted to know the number of digits in O/P using JAVASCRIPT. Ex ,if output is 5 : digit 1 if output is 20 :digit 2 o/p: output
3 Réponses
+ 6
hmmmmm?
Um challenge....accepted
and digit of 0 is 0 right?
also What is O/P? 😓
Ah Maybe you want to show the better way than mine right? if yes that such a spectacular thing of you! :D
https://code.sololearn.com/WY1fCYyjf3xR/?ref=app
+ 6
you can submit this challenge via lesson factory , as an assignment.
+ 5
var random=Math.floor(Math.random()*100)+1;
var r=random;
random=String(random);
var digit=random.length;
alert(r+" : "+digit+' digits')
//easy challenge
//btw does o/p means output