Buscar

3) Analyze the code below and choose the correct alternative: The code searches for a value in a matrix. The variable x is initialized with false....

3) Analyze the code below and choose the correct alternative:

The code searches for a value in a matrix.
The variable x is initialized with false.
The variable valor represents the value to be searched.
The variables linha and coluna store the position of the value in the matrix.
The code iterates over all elements of the matrix.
a) All affirmations are correct.
b) Only affirmations 1, 2 and 3 are correct.
c) Only affirmations 1, 4 and 5 are correct.
d) Only affirmations 1 and 5 are correct.

Essa pergunta também está no material:

AP2 - Computação I - 2017-2
2 pág.

Computação I Universidade Federal FluminenseUniversidade Federal Fluminense

💡 1 Resposta

User badge image

Ed Verified user icon

A alternativa correta é a letra c) Apenas as afirmações 1, 4 e 5 estão corretas. Explicação: 1. O código procura um valor em uma matriz. 2. A variável x é inicializada com false. 3. A variável valor representa o valor a ser procurado. 4. As variáveis linha e coluna armazenam a posição do valor na matriz. 5. O código itera sobre todos os elementos da matriz. A afirmação 2 é incorreta, pois a variável x é inicializada com false, mas é atualizada para true se o valor for encontrado na matriz.

0
Dislike0

Faça como milhares de estudantes: teste grátis o Passei Direto

Esse e outros conteúdos desbloqueados

16 milhões de materiais de várias disciplinas

Impressão de materiais

Agora você pode testar o

Passei Direto grátis

Você também pode ser Premium ajudando estudantes

✏️ Responder

SetasNegritoItálicoSublinhadoTachadoCitaçãoCódigoLista numeradaLista com marcadoresSubscritoSobrescritoDiminuir recuoAumentar recuoCor da fonteCor de fundoAlinhamentoLimparInserir linkImagemFórmula

Para escrever sua resposta aqui, entre ou crie uma conta

User badge image

Outros materiais