int array_exemplo[5];
Esta instrução realiza algo ao array_exemplo. O que se será?
Arrays 2022/02/15
Quiz
•
Computers
•
10th Grade
•
Easy
André Carvalho
Used 6+ times
FREE Resource
7 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
int array_exemplo[5];
Esta instrução realiza algo ao array_exemplo. O que se será?
Inicializa o array
Declara o array
insere 5 elementos no array
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
int array_exemplo[5];
Os indices deste array variam entre:
1 e 5
5 e 9
0 e 4
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Se pretender inicializar todos os elementos do seguinte array então o que deverá acrescentar ao final da seguinte instrução?
int array_exemplo[5]
= [3,4,6,7,23]
= {20,7,78,89}
= {56,23,34,99,2}
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
int array_exemplo[5] = {20 , 30 , 10 , 50 , 40};
for(int i = 0; i < ???? ; i++) {
cout << i << ": " << array_exemplo[i] << "\n"; }
Se quiser listar no ecrã os valores de todos os elementos do array então qual deverá ser o valor em falta (????) na condição do ciclo FOR?
4
20
5
5.
FILL IN THE BLANK QUESTION
1 min • 1 pt
A ________ de um dado valor x num array é realizada comparando esse valor com o 1º elemento do array e sucessivamente comparando x com cada um dos restantes elementos do array.
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Este é um extrato do código para ordenação crescente de um array. Na condição falta o sinal. Qual deverá ser?
>
<
=
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
int func( int valor )
{
int i;
for (i = 0; i < 5; i++){
if (array_exemplo[i] == valor)
return i;}
return -1;
}
Esta função realiza que operação?
Percorre todos os elementos do array array_exemplo.
Ordena o array array_exemplo.
Pesquisa um valor em 5 elementos do array array_exemplo. Caso encontre então retorna o indice do elemento.
10 questions
Kuis Percabangan dan Perulangan
Quiz
•
10th Grade
10 questions
Introduction to Arrays
Quiz
•
KG - University
11 questions
Caligrafía | CM7
Quiz
•
1st - 10th Grade
12 questions
Java - arrays and String methods
Quiz
•
9th - 12th Grade
10 questions
Белгіленген сипаттары бар элементті іздеу
Quiz
•
9th - 12th Grade
10 questions
Programming
Quiz
•
1st - 10th Grade
10 questions
Программирование C#
Quiz
•
1st - 10th Grade
10 questions
Arrays
Quiz
•
10th - 12th Grade
15 questions
Character Analysis
Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing
Quiz
•
9th - 12th Grade
10 questions
American Flag
Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension
Quiz
•
5th Grade
30 questions
Linear Inequalities
Quiz
•
9th - 12th Grade
20 questions
Types of Credit
Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25
Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers
Quiz
•
6th - 8th Grade
17 questions
Chapter 12 - Doing the Right Thing
Quiz
•
9th - 12th Grade
20 questions
Types of Credit
Quiz
•
9th - 12th Grade
30 questions
Linear Inequalities
Quiz
•
9th - 12th Grade
20 questions
Taxes
Quiz
•
9th - 12th Grade
17 questions
Parts of Speech
Quiz
•
7th - 12th Grade
20 questions
Chapter 3 - Making a Good Impression
Quiz
•
9th - 12th Grade
20 questions
Inequalities Graphing
Quiz
•
9th - 12th Grade
10 questions
Identifying equations
Quiz
•
KG - University