FastFoodCoding

Login


Connect with one of the following accounts





Login

Please wait while we redirect...

Views: 16   



Following program shows you how to scan name of user and say hello with name
In this program we get name from user using scanf method and prints hello with that name using fmt.Println()

package main

import "fmt"

func main() {
  var name string
  fmt.Print("Please enter your name:")
  fmt.Scanf("%s",&name)
  fmt.Println("Hello",name)
}

Output:

Please enter your name: Tom
Hello Tom



On By


Top Tutorials

Top Questions

Top Articles

Top Blogs

Top News