golang fmt.scanln whole line
scanner := bufio.NewScanner(os.Stdin)
if scanner.Scan() {
line := scanner.Text()
fmt.Printf("Input was: %qn", line)
}
golang fmt.scanln whole line
scanner := bufio.NewScanner(os.Stdin)
if scanner.Scan() {
line := scanner.Text()
fmt.Printf("Input was: %qn", line)
}
go fmt.scan
// Golang program to illustrate the usage of
// fmt.Scan() function
// Including the main package
package main
// Importing fmt
import (
"fmt"
)
// Calling main
func main() {
// Declaring some variables
var name string
var alphabet_count int
var float_value float32
var bool_value bool
// Calling Scan() function for
// scanning and reading the input
// texts given in standard input
fmt.Scan(&name)
fmt.Scan(&alphabet_count)
fmt.Scan(&float_value)
fmt.Scan(&bool_value)
// Printing the given texts
fmt.Printf("%s %d %g %t", name,
alphabet_count, float_value, bool_value)
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us