16 lines
421 B
Go
16 lines
421 B
Go
package main
|
|
|
|
import "fmt"
|
|
|
|
func add() {
|
|
// Prompt the user for the name and phone number of the new contact
|
|
var fname, lname, phone string
|
|
fmt.Printf("Enter the first name of the new contact: ")
|
|
fmt.Scanln(&fname)
|
|
fmt.Printf("Enter the last name of the new contact: ")
|
|
fmt.Scanln(&lname)
|
|
fmt.Printf("Enter the phone number: ")
|
|
fmt.Scanln(&phone)
|
|
fmt.Printf("You entered: Name: %s, Phone: %s\n", fname, phone)
|
|
}
|