Run ❯
Get your own website
×
Change Orientation
prog.go
Input
package main import ("fmt") func main() { var i,j int fmt.Print("Type two numbers: ") fmt.Scanln(&i, &j) fmt.Println("Your numbers are:", i, "and", j) }
// These are the input values you give to the program. // The program is looking for two inputs separated with spaces in one line. // So, 1 2 in one line gives you 1 2. If 1 2 are in two lines, the result is 1 0. // This is because the program stops after the new line. 1 2
Your numbers are: 1 and 2