renumber
This commit is contained in:
13
072-reading-input/reading-input.go
Normal file
13
072-reading-input/reading-input.go
Normal file
@@ -0,0 +1,13 @@
|
||||
// ## Reading Input
|
||||
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
fmt.Print("Enter a number: ")
|
||||
var input float64
|
||||
fmt.Scanf("%f", &input)
|
||||
output := input * 2
|
||||
fmt.Println(input, "* 2 =", output)
|
||||
}
|
||||
3
072-reading-input/reading-input.sh
Normal file
3
072-reading-input/reading-input.sh
Normal file
@@ -0,0 +1,3 @@
|
||||
$ go run reading-input.go
|
||||
Enter a number: 7
|
||||
7 * 2 = 14
|
||||
Reference in New Issue
Block a user