Skip to content

Commit 7e62a0e

Browse files
committed
count
1 parent 597643e commit 7e62a0e

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

Programs/DSA/count.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ function countofdigit(num) {
1010

1111
let count = 0
1212

13-
while (num > 0) {
14-
15-
num = Math.floor(num / 10)
16-
count++
13+
while (num > 0) { //251 // 25 //2
14+
15+
num = Math.floor(num / 10) //251/10=25 //25/10=2 //2/10=0
16+
count++ //1 2 3
1717
}
1818

1919
return count

0 commit comments

Comments
 (0)