add: exercise solution to numbers cels to fahr
This commit is contained in:
@ -0,0 +1,18 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
func main() {
|
||||
c, _ := strconv.ParseFloat(os.Args[1], 64)
|
||||
f := c*1.8 + 32
|
||||
|
||||
// Like this:
|
||||
fmt.Printf("%g ºC is %g ºF\n", c, f)
|
||||
|
||||
// Or just like this (both are correct):
|
||||
fmt.Printf("%g ºF\n", f)
|
||||
}
|
@ -38,5 +38,6 @@ func main() {
|
||||
fmt.Println(10 / 2 * 10 % 7)
|
||||
|
||||
// This expression should print 40
|
||||
// Note that you may need to use floats to solve this
|
||||
fmt.Println(100 / 5 / 2)
|
||||
}
|
||||
|
Reference in New Issue
Block a user