Created
February 6, 2025 18:20
-
-
Save Nancy-Lara-Baca/9c1246ed6a64c9eea8ff17b148c7d927 to your computer and use it in GitHub Desktop.
Función saludar( ) más función suma( )
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
//funciones basicas que no devuelve valor, | |
//pero ejecuta las instrucciones entre llaves | |
void saludar() { | |
print('Hola, mundo'); | |
} | |
void suma(){ | |
int n1 = 2; | |
int n2 = 7; | |
int s = n1 + n2; | |
print ("La suma de $n1 + $n2 es $s"); | |
} | |
void main() { | |
print("Nancy Lara 1225"); | |
// Llama a la función saludar | |
saludar(); | |
// Llama a la función suma | |
suma(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Función suma( )
![image](https://private-user-images.githubusercontent.com/179509056/410588937-27f5852e-d94c-4752-bf57-2f3bd89da2b5.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzMTQyNDEsIm5iZiI6MTczOTMxMzk0MSwicGF0aCI6Ii8xNzk1MDkwNTYvNDEwNTg4OTM3LTI3ZjU4NTJlLWQ5NGMtNDc1Mi1iZjU3LTJmM2JkODlkYTJiNS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjExJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxMVQyMjQ1NDFaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT04MGZmNWQ3ZDhmNzNlY2JjZDA4YmU5ODMyNWY5MjI2YTBkMTFlZjAzNTdjYTVhNWJiYzk5NDA0ZGM4OTY3MzQxJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.ptaGDUVg8Yl2Y0ji52KyEOZnYSY3srav_P-Cdcd4FWk)