Skip to content

Instantly share code, notes, and snippets.

@aldosaucedo1213
Created February 6, 2025 18:46
Show Gist options
  • Save aldosaucedo1213/d67323cb2ddeea0d13167e06f09154ba to your computer and use it in GitHub Desktop.
Save aldosaucedo1213/d67323cb2ddeea0d13167e06f09154ba to your computer and use it in GitHub Desktop.
ejemplo de funcion flecha
// funsiones basicas que devuelva el 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 ("aldo saucedo 22308051281310");
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");
}
@aldosaucedo1213
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