You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
699 B

# fishandchips
2 years ago
### Instructions
Write a function called `FishAndChips()` that takes an integer and returns a string.
2 years ago
- If the number is divisible by 3, print `chips` followed by a newline `\n`.
- If the number is divisible by 2 and 3, print `fish and chips` followed by a newline `\n`.
- If is not divisible by any of 3 and 2 print newline `\n`.
### Expected function
```go
func FishAndChips(n int32) string {
2 years ago
}
```
### Usage
Here is a possible program to test your function:
2 years ago
```go
package main
func main() {
args := []int32{0, 6, 33, -3, 5, 8}
for i := 0; i < len(args); i++ {
Fishandchips(args[i])
}
}
```
And its output:
2 years ago
```go
fish and chips$
fish and chips$
chips$
chips$
$
$
```