Created
February 6, 2025 18:52
-
-
Save Luis-Herrera1207/ee4cd202ed619471b638facaa4611ce1 to your computer and use it in GitHub Desktop.
Funcion de Parametros Opcionales
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 DEVUELVEN VALOR, SOLO EJECUTA INSTRUCCIONES | |
void saludar(String nombre, [String? mensaje]) { | |
print('Hola, $nombre. ${mensaje ?? ''}'); | |
} | |
void mostrarDatos({String? nombre, int? edad}) { | |
print('Nombre: $nombre, Edad: $edad'); | |
} | |
void main() { | |
print("HERRERA LUIS 22308051281207"); | |
saludar('Luis Herrera'); | |
mostrarDatos(nombre: 'Luis', edad: 17); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-SALIDA