Skip to content

Instantly share code, notes, and snippets.

@samueltcsantos
Last active February 28, 2022 19:31
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/357d8d43421f6d5e0b6b57b6e3ce7b3b to your computer and use it in GitHub Desktop.
Save samueltcsantos/357d8d43421f6d5e0b6b57b6e3ce7b3b to your computer and use it in GitHub Desktop.
Calculando a média de 4 notas em Go.
package main
import (
"fmt"
)
func main() {
var nota1, nota2, nota3, nota4 float32
fmt.Print("Digite a nota 1: ")
fmt.Scan(&nota1)
fmt.Print("Digite a nota 2: ")
fmt.Scan(&nota2)
fmt.Print("Digite a nota 3: ")
fmt.Scan(&nota3)
fmt.Print("Digite a nota 4: ")
fmt.Scan(&nota4)
media = (nota1+nota2+nota3+nota4)/4
fmt.Println("Media é ", media)
}
@samueltcsantos
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment