Created
November 14, 2021 16:24
-
-
Save felipecastrosales/57f5c2328145375e911f24f6bcce5599 to your computer and use it in GitHub Desktop.
Funções - Tipos de Retorno
This file contains hidden or 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
// 1. - Função do tipo void | |
// 2. - Função com tipo double, usando return | |
// 3. - Função com tipo double, usando Arrow-Function | |
void main() { | |
soma1(3, 4); | |
soma2(3, 4); | |
soma3(3, 4); | |
} | |
// 1. | |
void soma1(double a, double b) { | |
double resultado = a + b; | |
print(resultado); | |
} | |
// 2. | |
double soma2(double a, double b) { | |
double resultado = a + b; | |
return resultado; | |
} | |
// 3. | |
double soma3(double a, double b) => a + b; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment