Write a Go program to demonstrate the use of a for loop with range to iterate over an array.
EasyProblem Statement
Write a Go program to demonstrate the use of a for loop with range to iterate over an array.
Sample Input
An array of strings (e.g., ["Apple", "Banana", "Cherry"]).
Sample Output
Index: 0, Value: Apple Index: 1, Value: Banana Index: 2, Value: Cherry
Limits
Time: 2s · Memory: 256 MB
Code Editor
00:00
package main
import "fmt"
func main() {
// Iterate over the array using a range loop
}
Input
An array of strings (e.g., ["Apple", "Banana", "Cherry"]).
Expected Output
Index: 0, Value: Apple Index: 1, Value: Banana Index: 2, Value: Cherry