From 35a2939d0b2937468f2bf021252148b9c8cb090d Mon Sep 17 00:00:00 2001 From: zainabdnaya Date: Sat, 30 Jul 2022 03:39:11 +0100 Subject: [PATCH] Fishandchips --- subjects/fishandchips/README.md | 40 +++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 subjects/fishandchips/README.md diff --git a/subjects/fishandchips/README.md b/subjects/fishandchips/README.md new file mode 100644 index 000000000..f38ad7a93 --- /dev/null +++ b/subjects/fishandchips/README.md @@ -0,0 +1,40 @@ +# Fishandchips + +### Instructions + +Write a function called `Fishandchips()` Write a function that takes an integer and returns a string. + +- 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 { +} +``` +### Usage + +Here is a possible program to test your function: + +```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 : + +```go +fish and chips$ +fish and chips$ +chips$ +chips$ +$ +$ +```