From 294315a72b022dac7dae35ef36e2abca14ff68f0 Mon Sep 17 00:00:00 2001 From: zainabdnaya Date: Mon, 13 Jun 2022 16:10:19 +0100 Subject: [PATCH] feat : Add devisors subject --- subjects/divisors/README.md | 38 +++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 subjects/divisors/README.md diff --git a/subjects/divisors/README.md b/subjects/divisors/README.md new file mode 100644 index 00000000..f22d3f5f --- /dev/null +++ b/subjects/divisors/README.md @@ -0,0 +1,38 @@ +# Devisor + +### Instructions + +Write a function that takes a positive integer and returns the number of it's devisors. +- If the the number a is negative return 0. + +### Expected function +```go +func Divisors(n int) int { + ... +} +``` +### Usage + +```go +package main + +import ( + "fmt" + "piscine" +) + +func main() { + fmt.Println(piscine.Divisors(4))// 4 can be divided by 1 and 2 and 4 + fmt.Println(piscine.Divisors(5))//5 can be divided by 1 and 5 +} + +``` + +And its output : + + +```console +$ go run . +3 +2 +``` \ No newline at end of file