Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Verifique o SEGUNDO maior número utilizando um laço de repetição #40

Open
kellykn96 opened this issue Oct 18, 2020 · 0 comments
Open

Comments

@kellykn96
Copy link

kellykn96 commented Oct 18, 2020

Percorra uma lista em qualquer linguagem, imprimindo na tela o segundo maior número dessa lista.

Exemplo: let lista= [2, 4, 6, 8, 10].

O segundo maior número é 8.

Se você precisar de um start, aqui vai uma ajudinha de como achar o maior.

let comparador = 0

for (let numero of lista){
if (numero>comparador){
comparador = numero
}

console.log(comparador)

@kellykn96 kellykn96 changed the title Desafio Maior de 3 Verifique o SEGUNDO maior número utilizando um laço de repetição Oct 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant