Skip to content

Instantly share code, notes, and snippets.

@AndresRivera111
Created February 6, 2025 18:46
Show Gist options
  • Save AndresRivera111/a8efc7d6e47ffcfbaa79c14b255f2b6b to your computer and use it in GitHub Desktop.
Save AndresRivera111/a8efc7d6e47ffcfbaa79c14b255f2b6b to your computer and use it in GitHub Desktop.
Ejemplo de funcion flecha
// funciones basicas que no devuelven valor,
// pero ejecuta las instrucciones entre llaves
int resta (int a, int b){
return a - b;
}
int flecharesta (int a, int b) => a - b;
void main() {
print("Andres Rivera 22308051281295");
int x = 9;
int y = 3;
print("Funcion resta normal");
int r = resta(x,y);
print ("La resta de $x - $y es: $r");
print("funcion resta tipo flecha");
int r1 = flecharesta(12,2);
print("la resta de flecharesta (12,2) es $r1");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment