Consider the following vector: [-5, 10, -3, 12, -9, 5, 90, 0, 1]; Implement an algorithm that analyzes the vector above and automatically creates a second vector containing only the positive numbers. Show this new vector on the screen.
programa
{
funcao inicio()
{
inteiro vetor[] = {-5, 10, -3, 12, -9, 5, 90, 0, 1}
para (inteiro posicao = 0; posicao < 9; posicao++)
{
se (vetor[posicao]>0)
{
escreva (vetor[posicao],"\n")
}
}
}
}
Via Active questions tagged javascript - Stack Overflow https://ift.tt/XIp7yGY
Comments
Post a Comment