Files
adventofcode2025/test/main.go
Javier-Orestis MANTZIOS 108f50e8ea initialise
2025-01-07 10:39:37 +02:00

18 lines
351 B
Go

package main
import "fmt"
func main() {
// Initialize the variable before the loop
value := 0
for i := 0; i < 5; i++ {
// Change its value within the loop
value += i
fmt.Println("Current Value:", value) // Use the variable here
}
fmt.Println("Final Value:", value) // Still accessible after the loop
}