diff --git a/hello.go b/hello.go index a3dd973..68de9aa 100644 --- a/hello.go +++ b/hello.go @@ -2,6 +2,6 @@ package main import "fmt" -func main() { +func old_main() { fmt.Println("Hello, World!") } diff --git a/trunc.go b/trunc.go new file mode 100644 index 0000000..733a0d5 --- /dev/null +++ b/trunc.go @@ -0,0 +1,12 @@ +package main + +import "fmt" + +func main() { + var userFloat float32 + fmt.Println("Enter a floating point number: ") + + fmt.Scan(&userFloat) + + fmt.Printf("%.0f", userFloat) +}