forked from root/public
Compare commits
4 Commits
master
...
1122-buz-z
Author | SHA1 | Date |
---|---|---|
zainabdnaya | a9e52165fa | 2 years ago |
zainabdnaya | 8702c4b76b | 2 years ago |
zainabdnaya | fef4b725e3 | 2 years ago |
zainabdnaya | 8467b73de6 | 2 years ago |
1 changed files with 54 additions and 0 deletions
@ -0,0 +1,54 @@
|
||||
# buzzinga |
||||
|
||||
### Instructions |
||||
Write a function named `BuzZinga()` that takes a number as an argument and prints the following: |
||||
|
||||
If the number is divisible by 3, print Buz followed by a newline. |
||||
If the number is divisible by 5, print Zinga followed by a newline. |
||||
If the number is divisible by 3 and 5, print BuzZinga followed by a newline. |
||||
If the number is not divisible by 3 or 5, print * followed by a newline. |
||||
|
||||
### Expected function |
||||
|
||||
```go |
||||
func BuzZinga(number int) { |
||||
|
||||
} |
||||
``` |
||||
### Usage |
||||
|
||||
Here is a possible program to test your function: |
||||
|
||||
```go |
||||
package main |
||||
|
||||
import ( |
||||
"fmt" |
||||
"piscine" |
||||
) |
||||
|
||||
func main() { |
||||
fmt.Println(piscine.BuzZinga(15)) |
||||
} |
||||
``` |
||||
And its output : |
||||
|
||||
```go |
||||
$ go run . | cat -e |
||||
*$ |
||||
*$ |
||||
Buz$ |
||||
*$ |
||||
Zinga$ |
||||
Buz$ |
||||
*$ |
||||
*$ |
||||
Buz$ |
||||
Zinga$ |
||||
*$ |
||||
Buz$ |
||||
*$ |
||||
*$ |
||||
BuzZinga$ |
||||
|
||||
``` |
Loading…
Reference in new issue