Last active
February 28, 2022 19:31
-
-
Save samueltcsantos/357d8d43421f6d5e0b6b57b6e3ce7b3b to your computer and use it in GitHub Desktop.
Calculando a média de 4 notas em Go.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
) | |
func main() { | |
var nota1, nota2, nota3, nota4 float32 | |
fmt.Print("Digite a nota 1: ") | |
fmt.Scan(¬a1) | |
fmt.Print("Digite a nota 2: ") | |
fmt.Scan(¬a2) | |
fmt.Print("Digite a nota 3: ") | |
fmt.Scan(¬a3) | |
fmt.Print("Digite a nota 4: ") | |
fmt.Scan(¬a4) | |
media = (nota1+nota2+nota3+nota4)/4 | |
fmt.Println("Media é ", media) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Check out my page to see other examples Mais exemplos ...