Skip to content

Instantly share code, notes, and snippets.

@Balderrama-Karla-5J
Created February 6, 2025 18:45
Show Gist options
  • Save Balderrama-Karla-5J/a4e07e3277a99deb0a8354f0fa3c0b11 to your computer and use it in GitHub Desktop.
Save Balderrama-Karla-5J/a4e07e3277a99deb0a8354f0fa3c0b11 to your computer and use it in GitHub Desktop.
Ejemplo función flecha
//funciones basicas que devuelve valor
//y ejecuta las instrucciones entre llaves
int resta(int a, int b){
return a-b;
}
//funcion flecha
int flecharesta(int a, int b) => a-b;
void main() {
print("Karla Alejandra Balderrama Padilla 22308051281149");
//llamar a la funcion saludar()
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");
}
@Balderrama-Karla-5J
Copy link
Author

Salida el ejemplo flecha resta
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment