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, 22.06.2019 22:30
You are new to microsoft certification and want to start out by getting a certification geared around windows 8. what microsoft certification should you pursue?
Answers: 1
question
Computers and Technology, 23.06.2019 06:30
Which option correctly describes a dbms application? a. software used to manage databases b. software used to organize files and folders c. software used to develop specialized images d. software used to create effective presentations
Answers: 1
question
Computers and Technology, 23.06.2019 14:00
In which job role will you be creating e-papers, newsletters and preiodicals
Answers: 1
question
Computers and Technology, 24.06.2019 15:00
Universal windows platform is designed for which windows 10 version?
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, 11.03.2021 01:00
question
Mathematics, 11.03.2021 01:00
Questions on the website: 13722362