feat: algoritmo 6 e 7

This commit is contained in:
Patrick Reis Santos 2022-10-30 20:53:26 -03:00
parent 26f091d1f3
commit 176d485260
2 changed files with 15 additions and 5 deletions

View File

@ -1,4 +1,8 @@
export function sum(values) { export function sum(values) {
let soma = 0;
for (let i = 0; i < values.length; i++) {
soma += values[i];
}
return soma;
// implementar logica aqui // implementar logica aqui
}
}

View File

@ -1,4 +1,10 @@
export function sumEven(value) { export function sumEven(value) {
// implementar logica aqui let soma = 0;
for (let i = 0; i <= value.length; i++) {
} if (value[i] % 2 === 0) {
soma += value[i];
}
}
return soma;
// implementar logica aqui if (variavel % 2 !== 0)
}