Basic Input Concepts in Go
๐ Scenario: You are creating a simple Go program that asks a user for their name and age, then greets them with this information.
๐ฏ Goal: Build a Go program that reads user input for name and age, then prints a greeting message including both.
๐ What You'll Learn
Use
fmt.Scanln to read user inputStore the name in a variable called
nameStore the age in a variable called
agePrint the greeting using
fmt.Printf with the exact format๐ก Why This Matters
๐ Real World
Reading user input is essential for interactive command-line tools and simple programs that need user data.
๐ผ Career
Understanding basic input/output in Go is important for backend development, scripting, and building CLI applications.
Progress0 / 4 steps