You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// This is a simple program that shows how to use go in taking inputs from a console... It takes in name and age as inputs and then uses conditionals to see if the age is permitted to continue
2
+
package main
3
+
4
+
import"fmt"
5
+
6
+
funcmain() {
7
+
fmt.Printf("What's your name? : ")
8
+
varnamestring
9
+
fmt.Scanln(&name)
10
+
fmt.Printf("How old are you? : ")
11
+
varageint
12
+
fmt.Scanln(&age)
13
+
ifage<18 {
14
+
fmt.Println(name, "You are too young to continue! ")
0 commit comments