From 682eb949c2c659f653e28aacac02dc6c9199b1cd Mon Sep 17 00:00:00 2001 From: Jyoti Singla <56391719+jyotisingla08@users.noreply.github.com> Date: Sat, 23 Oct 2021 13:40:05 +0530 Subject: [PATCH] Create StringArray.go String array --- GO/StringArray.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 GO/StringArray.go diff --git a/GO/StringArray.go b/GO/StringArray.go new file mode 100644 index 0000000..0206623 --- /dev/null +++ b/GO/StringArray.go @@ -0,0 +1,18 @@ +package main + +import "fmt" + +func main() { + +// Shorthand declaration of array +arr:= [4]string{"geek", "gfg", "Geeks1231", "GeeksforGeeks"} + +// Accessing the elements of +// the array Using for loop +fmt.Println("Elements of the array:") + +for i:= 0; i < 3; i++{ +fmt.Println(arr[i]) +} + +}