subject

Consider the following program fragment: (a)
int q = 0;
for (int i = 1; i < 11; i i. 2)
9 9 i;
System. out. print(a - 1);
)
The following two fragments were intended to produce the same output as fragment (É™);
(b)
int q = 0;
while (a < 11)
int i = 1;
99 + i;
ii + 2;
System. out. print(q - 1);
)
(0)
int a
int i;
do
99. i;
System. out. print(9 - 1);
) while (i (11);
Write down the output for each of the fragments (a), (b) and (c). Show your workings by, for example, providing a hand-tracing table.
Indicate how (b) and (c) could be modified (with as few changes as possible) so that the resulting code would produce the same output
as (a)


Consider the following program fragment:

(a)
int q = 0;
for (int i = 1; i < 11; i i. 2)
9 9 i;

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 09:00
Which best describes the role or restriction enzymes in the analysis of edna a. to break dna into fragments that vary in size so they can be sorted and analyzed b. to amplify small amounts of dna and generate large amounts of dna for analysis c. to purify samples of dna obtained from the environment so they can be analyzed d. to sort different sizes of dna fragments into a banding pattern that can be analyzed
Answers: 1
question
Computers and Technology, 23.06.2019 17:00
Companies that implement and apply an information system effectively can create
Answers: 1
question
Computers and Technology, 24.06.2019 03:30
Explain the importance of html in web page designing in 20 sentences..
Answers: 1
question
Computers and Technology, 24.06.2019 05:30
Cómo pongo un tomo de llamada sin pagar?
Answers: 1
You know the right answer?
Consider the following program fragment: (a)
int q = 0;
for (int i = 1; i < 11; i i....
Questions
question
Mathematics, 01.06.2021 20:20
question
Mathematics, 01.06.2021 20:20
question
Mathematics, 01.06.2021 20:20
question
Mathematics, 01.06.2021 20:20
question
Mathematics, 01.06.2021 20:20
Questions on the website: 13722367