package main
import "fmt"
type Person struct {
Name string
Age int
IsAdult bool
}
func main() {
// Step 1: Declare a variable of type Person
var p1 Person
// Step 2: Access fields of the struct
fmt.Println("Name:", p1.Name)
fmt.Println("Age:", p1.Age)
fmt.Println("IsAdult:", p1.IsAdult)
// Step 3: Assign values to the fields
p1.Name = "John"
p1.Age = 25
p1.IsAdult = p1.Age >= 18
// Step 4: Access fields after assigning values
fmt.Println("Name:", p1.Name)
fmt.Println("Age:", p1.Age)
fmt.Println("IsAdult:", p1.IsAdult)
}