Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created March 6, 2018 16:57
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 parzibyte/c66c90040a56f27733e74baf361b4a0b to your computer and use it in GitHub Desktop.
Save parzibyte/c66c90040a56f27733e74baf361b4a0b to your computer and use it in GitHub Desktop.
package main
import "fmt"
func main() {
var numero1, numero2 int // Declarar variables de tipo entero
/*
Pedir datos por teclado
*/
fmt.Print("Número 1: ")
fmt.Scanln(&numero1)
fmt.Print("Número 2: ")
fmt.Scanln(&numero2)
// Sumar
suma := numero1 + numero2
// Imprimir resultado
fmt.Printf("%d + %d = %d", numero1, numero2, suma)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment