Advertisement
Spocoman

04. Inches to Centimeters

Sep 12th, 2024 (edited)
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.30 KB | None | 0 0
  1. package main
  2. import "fmt"
  3.  
  4. func main() {
  5.     var inches float32
  6.     fmt.Scanln(&inches)
  7.    
  8.     var centimeters = inches * 2.54
  9.  
  10.     fmt.Println(centimeters)
  11. }
  12.  
  13. ИЛИ:
  14.  
  15. package main
  16. import "fmt"
  17.  
  18. func main() {
  19.     var inches float32
  20.     fmt.Scanln(&inches)
  21.  
  22.     fmt.Println(inches * 2.54)
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement