Created with <3 with dartpad.dev.
Created
October 17, 2023 02:35
-
-
Save leonus96/2512986d3d9897d48a48ae75dab30e09 to your computer and use it in GitHub Desktop.
opearadores
This file contains hidden or 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
void main() { | |
/// OPERADORES | |
/// Operador Aritmeticos | |
/// + : suma | |
/// - : resta | |
/// * : multiplicación | |
/// / : división | |
/// Ejemplos | |
/// double a = 10.4; | |
/// double b = 5.6; | |
/// double suma = a + b; | |
/// double resta = b - a; | |
/// double multiplicacion = b * a; | |
/// double division = a / b; | |
/// Operadores Logicos | |
/// == : comparación de igualdad | |
/// != : comparación de desigualdad | |
/// > | >=: (mayor|mayor igual) que | |
/// < | <= : (menor|menor igual) que | |
/// && : AND (y) | |
/// ||: OR (o) | |
/// ! : NOT (negación) | |
/// Los operadores de comparación se utilizan para comparar variables | |
/// y devuelven valores booleanos (true/false) según la relación entre ellas. | |
/// Ejemplos: | |
/// int a = 10; | |
/// int b = 15; | |
/// var esIgual = a == b; | |
/// var noEsIgual = a != b; | |
/// final resultado = a > b; | |
/// final resultado = a >= b; | |
/// final resultado = a < b; | |
/// final resultado = a <= b | |
/// bool and = a || b; | |
/// bool or = a || b; | |
/// bool negacion = !a; | |
/// NOTA: | |
/// ------------------- | |
/// REGLAS LOGICAS: | |
/// true && true = true | |
/// true && false = false | |
/// false && false = false | |
/// true || true = true | |
/// true || false = true | |
/// false || false = false | |
/// !true ==> false | |
/// !false ==> true | |
/// ------------------- | |
/// Imprimir directamente una operacion | |
/// int a = 5; | |
/// int b = 10; | |
/// print('El resultado es: ${a + b}'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment