Computer Science, asked by deepikatiwari6845, 11 months ago

How to get the number of digits in an integer javascript

Answers

Answered by mdkumar591
0

Answer:

Write a JavaScript function to count the digits of an integer. Sample Solution:- HTML Code: <! JavaScript Code: function digits_count(n) { var count = 0; if (n >= 1) ++count; while (n / 10 >= 1) { n /= 10; ++count; } return count; } console.log(digits_count(12112)); console.log(digits_count(457)); Flowchart

please make it as brainliest

Similar questions