Created
March 6, 2018 05:59
-
-
Save parzibyte/884cac1df2547305e30bfe8b81f7c14f 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(){ | |
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