I've been looking for a way how to have a syntax like this in C
scanf("%d",&num);
and I've found out in Go Lanuguage you can use this
fmt.scanf("%d",&num)
The problem is when I'll use it twice, it doesn't allow me to enter a value on the second part.
Example:
package main
import "fmt"
func main() {
var name string
var age int
fmt.Print("Enter your name: ")
fmt.Scanf("%s", &name)
fmt.Print("
Enter your age: ")
fmt.Scanf("%d", &age)
fmt.Println(name,"is",age,"years of Age")
}
Sample input name=Jack and age=18(this is the part of the problem wherein it doesn't allow me to input for the age) it will display
Jack is 0 years of age