Write a Go program to define and use a struct with fields Name and Age.
EasyProblem Statement
Write a Go program to define and use a struct with fields Name and Age.
Sample Input
A struct instance with fields initialized (e.g., {"John", 25}).Sample Output
Name: John, Age: 25
Limits
Time: 2s · Memory: 256 MB
Code Editor
00:00
package main
import "fmt"
type Person struct {
Name string
Age int
}
func main() {
// Define a struct and print its fields
}
Input
A struct instance with fields initialized (e.g., {"John", 25}).Expected Output
Name: John, Age: 25