Compare commits

...

10 Commits

Author SHA1 Message Date
zainabdnaya c69ab67f11 corrected 2 years ago
zainabdnaya 71472ab94d Merge branch '1162-numofdigits' of https://github.com/01-edu/public into 1162-numofdigits 2 years ago
zainabdnaya 75d5db05d9 numofdegit 2 years ago
Hamza elkhatri bb26c19359
Update README.md 2 years ago
zainabdnaya 0df69140b0 numofdegit 2 years ago
zainabdnaya 4eb4b6566d numofdegit 2 years ago
zainabdnaya b76f31da0c Correcting number of digits 2 years ago
zainabdnaya f8be55413a Correcting number of digits 2 years ago
zainabdnaya a70a9e20db Correcting number of digita 2 years ago
zainabdnaya dfdae345c1 feat Add numofdigits subject 2 years ago
  1. 44
      subjects/numofdigits/README.md

44
subjects/numofdigits/README.md

@ -0,0 +1,44 @@
## number of digits
### Instructions
Write a function that returns the number of digits in a positive integer n.
- if the number is negative returns 0.
### Expected function
```go
func Numofdigits(num int) int {
}
```
### Usage
Here is a possible program to test your function:
```go
package main
import (
"fmt"
)
func main() {
fmt.Println(Numofdigits(3))
fmt.Println(Numofdigits(245))
fmt.Println(Numofdigits(-1))
fmt.Println(Numofdigits(885))
fmt.Println(Numofdigits(8574))
}
```
And its output :
```console
$ go run .
1
3
0
3
4
Loading…
Cancel
Save