Quiz 3_ Attempt review _ eClass
pdf
keyboard_arrow_up
School
University of Alberta *
*We aren’t endorsed by this school
Course
201
Subject
Mathematics
Date
Apr 3, 2024
Type
Pages
6
Uploaded by SuperHumanSteel1194
3/29/24, 12:35 AM
Quiz 3: Attempt review | eClass
https://eclass.srv.ualberta.ca/mod/quiz/review.php?attempt=14818376&cmid=7580380
1/6
Started on
Wednesday, 7 February 2024, 10:28 PM
State
Finished
Completed on
Wednesday, 7 February 2024, 10:48 PM
Time taken
19 mins 59 secs
Grade
9.00
out of 10.00 (
90
%)
Question 1
Correct
Mark 1.00 out of 1.00
Suppose we initialize a 2D array as follows:
int a[3][3] = {1, 2, 3, 4, 5};
What is the value of a[3][0]
?
a.
3
b.
4
c.
5
d.
2
e.
1
f.
0
g.
The code will cause a syntax error.
h.
Garbage value.
Your answer is correct.
The correct answer is:
Garbage value.
cross out
cross out
cross out
cross out
cross out
cross out
cross out
cross out
3/29/24, 12:35 AM
Quiz 3: Attempt review | eClass
https://eclass.srv.ualberta.ca/mod/quiz/review.php?attempt=14818376&cmid=7580380
2/6
Question 2
Correct
Mark 1.00 out of 1.00
Question 3
Correct
Mark 1.00 out of 1.00
Suppose the variable a
refers to a 1-dimensional array. Then, the assignment expression a = 5
will set the value of the first element to 5.
Select one:
True
False. a
on its own cannot be used to set the first element.
False. a
is not an lvalue.
Your answer is correct.
Click "Next page" to continue
The correct answer is: False. a
on its own cannot be used to set the first element.
Suppose we initialize an array using the following line:
int a[10] = {[5] = 100};
What is the effect of that initialization statement?
Select one:
It sets a[5]
to 100, and the other 9 elements will be 0.
It sets the first 5 elements of a
to 100, and the other 5 elements will
not be initialized.
It sets the first 5 elements of a
to 100, and the other 5 elements will
be 0.
It sets a[5]
to 100, and the other 9 elements will not be initialized.
Your answer is correct.
Click "Next page" to continue
The correct answer is: It sets a[5]
to 100, and the other 9 elements will be 0.
cross out
cross out
cross out
cross out
cross out
cross out
cross out
3/29/24, 12:35 AM
Quiz 3: Attempt review | eClass
https://eclass.srv.ualberta.ca/mod/quiz/review.php?attempt=14818376&cmid=7580380
3/6
Question 4
Correct
Mark 1.00 out of 1.00
What is the output of the following code snippet?
int x, y = 11;
for (x = 11; x <= 20; x += 3) {
printf("%d %d\n", x, --y);
}
Select one:
10 11
9 14
8 17
7 20
11 10
12 9
13 8
14 7
11 10
14 9
17 8
20 7
10 11
9 12
8 13
7 14
Your answer is correct.
The correct answer is:
11 10
14 9
17 8
20 7
cross out
cross out
cross out
cross out
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
3/29/24, 12:35 AM
Quiz 3: Attempt review | eClass
https://eclass.srv.ualberta.ca/mod/quiz/review.php?attempt=14818376&cmid=7580380
4/6
Question 5
Correct
Mark 1.00 out of 1.00
Question 6
Correct
Mark 1.00 out of 1.00
In the array int a[5][10]
, which element will a[3,4]
access?
Select one:
a[7]
a[3][4]
a[3]
a[4]
This is a syntax error.
Your answer is correct.
Click "Next page" to continue
The correct answer is: a[4]
What are the parts that compose an unsigned float
.
a.
Decimal
b.
Exponent
c.
Fraction
d.
Sign
e.
Integer
Your answer is correct.
The correct answers are:
Fraction,
Exponent
cross out
cross out
cross out
cross out
cross out
cross out
cross out
cross out
cross out
cross out
3/29/24, 12:35 AM
Quiz 3: Attempt review | eClass
https://eclass.srv.ualberta.ca/mod/quiz/review.php?attempt=14818376&cmid=7580380
5/6
Question 7
Correct
Mark 1.00 out of 1.00
Question 8
Correct
Mark 1.00 out of 1.00
A float
and double
have the same maximum value. Only the precision is different between the two.
Select one:
True
False
Your answer is correct.
Click "Next page" to continue
The correct answer is: False
In the following lines of code, what will be the value of ch
if 65
is entered in stdin
?
char ch;
scanf("%c", &ch);
Select one:
'6'
'5'
'A'
"65"
'a'
Your answer is correct.
Click "Next page" to continue
The correct answer is: '6'
cross out
cross out
cross out
cross out
cross out
cross out
cross out
3/29/24, 12:35 AM
Quiz 3: Attempt review | eClass
https://eclass.srv.ualberta.ca/mod/quiz/review.php?attempt=14818376&cmid=7580380
6/6
Question 9
Correct
Mark 1.00 out of 1.00
Question 10
Incorrect
Mark 0.00 out of 1.00
What is the expression a < b < c
equivalent to?
Select one:
a < b && b < c
(a < b) < c
a < b || b < c
a < (b < c)
Your answer is correct.
Click "Next page" to continue
The correct answer is: (a < b) < c
How many times will the printf
being executed in the following code block?
int i = 5;
for (int i = 0; i < 10; ++i);
printf("%d\n", i);
a.
5
b.
1
c.
10
d.
Infinitely many times
e.
0
Your answer is incorrect.
The correct answer is:
1
cross out
cross out
cross out
cross out
cross out
cross out
cross out
cross out
cross out
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help