Skip to content

Instantly share code, notes, and snippets.

@samueltcsantos
Created March 4, 2022 00:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samueltcsantos/463b586b98784848f1b2864a8f71cfa7 to your computer and use it in GitHub Desktop.
Save samueltcsantos/463b586b98784848f1b2864a8f71cfa7 to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"math"
)
func main() {
var numero float64
fmt.Print("Digite um número: ")
fmt.Scan(&numero)
if numero - math.Round(numero) != 0 {
fmt.Println("Decimal")
} else {
fmt.Println("Inteiro")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment