Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created March 6, 2018 05:59
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/884cac1df2547305e30bfe8b81f7c14f to your computer and use it in GitHub Desktop.
Save parzibyte/884cac1df2547305e30bfe8b81f7c14f to your computer and use it in GitHub Desktop.
package main
import "fmt"
func main(){
if 5 > 0 && 10 > 9{
// Algo si se cumplen ambas condiciones
// En este caso se cumplen ambas
fmt.Println("5 > 0 && 10 > 9")
}
if 1 < 2 && 5 > 1{
// 5 es mayor que 1, pero 1 no es menor que 2, así que no se cumple
fmt.Println("1 < 2 && 5 > 1")
}
if 4 > 9 || 3 < 10{
// Ejecutar algo si una de las dos condiciones se cumple
// En este caso se cumplirá 3 < 10, aunque 4 > 9 no
fmt.Println("4 > 9 || 3 < 10")
}
if 50 < 40 || 0 > 5{
// No se cumple ninguna condición
fmt.Println("50 < 40 || 0 > 5")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment