Created
March 6, 2018 16:57
-
-
Save parzibyte/c66c90040a56f27733e74baf361b4a0b to your computer and use it in GitHub Desktop.
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 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