using %s and %d



package main
import "fmt"

func main() {
  my_name := "JimS"
  my_age := 34 
  my_height := 74
  my_weight := 180 
  my_eyes := "brown"
  my_hair := "black"

  fmt.Printf("My name is %s.\n", my_name)
  fmt.Printf("I'm about %d inches tall.\n", my_height)
  fmt.Printf("I used to be %d pounds heavy.\n", my_weight)
  fmt.Printf("I have %s eyes and %s hair.\n", my_eyes, my_hair)
  fmt.Printf("adding these %d, %d, %d equals %d\n", 
    my_age, my_height,my_weight, my_age + my_height + my_weight)
}

No comments:

Post a Comment