Skip to content

Instantly share code, notes, and snippets.

@akshaybharambe14
Created March 10, 2020 17:11
Show Gist options
  • Save akshaybharambe14/b18b31b66f90c7523daf091b3fb4d501 to your computer and use it in GitHub Desktop.
Save akshaybharambe14/b18b31b66f90c7523daf091b3fb4d501 to your computer and use it in GitHub Desktop.

Revisions

  1. akshaybharambe14 created this gist Mar 10, 2020.
    18 changes: 18 additions & 0 deletions digitCount.go
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    package main

    import (
    "fmt"
    )

    func main() {
    fmt.Println(CountDigits(1234454666))
    }

    func CountDigits(i int64) (count int64) {
    for i > 0 {
    i = i / 10
    count++
    }

    return
    }