Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import "fmt"
- func main() {
- var number float64
- for ; ; {
- fmt.Scanln(&number)
- if(number >= 0) {
- fmt.Printf("Result: %.2f\n", number * 2)
- } else {
- fmt.Println("Negative number!")
- break
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement