Practice Real Company Assessment Patterns • Latest 2025–2026 Mock Tests

Programming Exercises

Write a Go program to create a slice of strings and append a new string to it.

Easy

Problem Statement

Write a Go program to create a slice of strings and append a new string to it.

Sample Input

A slice of strings (e.g., ["Apple", "Banana"]) and a string to append (e.g., "Cherry").

Sample Output

[Apple Banana Cherry]

Limits

Time: 2s · Memory: 256 MB

Code Editor
00:00
package main import "fmt" func main() { // Create a slice and append a new string to it }
Log in or sign up to run or submit your code.Log inSign up
Input
A slice of strings (e.g., ["Apple", "Banana"]) and a string to append (e.g., "Cherry").
Expected Output
[Apple Banana Cherry]