Created
November 14, 2021 15:43
-
-
Save felipecastrosales/8211180a00c957613b0f40abf0d840f5 to your computer and use it in GitHub Desktop.
Funções Introdução
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. - `void`: é o tipo de retorno da função. → Pode ser qualquer `DataType`. | |
// 2. - `main`: o nome que a função receberá. | |
// 3. - `()`: passa os parâmetros - caso existam/necessários. | |
// 4. - `{}`: determina o corpo da função - a execução da função será feita aqui. | |
// 1. 2. 3. 4. | |
void main () { | |
soma(3, 4); | |
} | |
// 1. 2. 3. 4. | |
void soma(double a, double b) { | |
double resultado = a + b; | |
print(resultado); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment