1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
ki77a [65]
3 years ago
13

How many iterations for each for-loop where max = 10 and incr = 3 a. for (int i = 0; i < max; i++) b. for (int i = 0; i <

max; i += 2) c. for (int i = 0; i < max; i += incr) d. for (int i = incr; i < max; i += incr) e. for (int i = max; i > 0; i--) f. for (int i = max; i < 0; i--) g. for (int i = 1; i < max; i *= incr) h. for (int i = 0; i < max; i *= incr)
Computers and Technology
1 answer:
LekaFEV [45]3 years ago
4 0

Explanation:

Answer to the following iterations are:

a)

In the following for-loop, the loop will starts from 0 and end at 9.

for example:

0 1 2 3 4 5 6 7 8 9

So, the loop will iterate 0-9, which means 10 times.

b)

In the following for-loop, the loop will starts from 0 and end at 8 but in the gap of 2 because of the increment of 2 in the variable "i".

for example:

0 2 4 6 8

So, the loop will iterate even times or 5 times, which means 0 2 4 6 8.

c)

In the following for-loop, the loop will starts from 0 and end at 9 but in the gap of 3  because of the increment of 3 in the variable "i" and the value is assign in the variable "incr" is 3.

for example:

0 3 6 9

So, the loop will iterate 4 times, which means 0 3 6 9.

d)

In the following for-loop, the loop will starts from 3 and end at 9 but in the gap of 3  because of the increment of 3 in the variable "i" and the value is assign in the variable "incr" is 3.

for example:

3 6 9

So, the loop will iterate 3 times, which means 3 6 9.

e)

In the following for-loop, the loop will starts from 10 and end at 1 which means reverse order.

for example:

10 9 8 7 6 5 4 3 2 1

So, the loop will iterate 10-1, which means 10 times in reverse order.

f)

In the following for-loop, the loop will not works because of the condition which is i is less than 0 but in the following code loop will starts from 3.

So, that's why loop will not iterate.

g)

In the following for-loop, the loop will starts from 1 and end at 9 but in the multiple of 3  because the variable "i" will multiply by the variable "incr" and the value is assign in the variable "incr" is 3.

for example:

1 3 9

So, the loop will iterate 3 times, which means 1 3 9.

h)

In the following for-loop, the loop is the infinite loop because of the condition which is i is less than max but and the loop will starts from 0 and goes on infinite times.

So, that's why it is the infinite loop.

You might be interested in
IT professionals ensure servers connected to the network operate properly. (2 points) True False
Nonamiya [84]

Answer:

True

Explanation:

Thats one of their most important jobs

3 0
3 years ago
What is the term for a server at the highest level of the Domain Name System (DNS)?
Igoryamba

Answer:

Root name server, root level server, or root server.

Explanation:

Root level server, root name server or simply root server is the server responsible for basic functions in translating domain names into IP addresses.  It is situated in the root zone of the domain name system (DNS) which is the largest layer in the DNS' name space.  

<em>Hope this helps!</em>

5 0
4 years ago
What is a partition gap, and how might it be used to hide data?â?
o-na [289]
Partition is a logical drive.  Large disks have to be partitioned in order to be structured. Knowing what partition is, partition gap refers to the unused space between partitions. It is also "Inter-partition<span> space" which</span><span> can be used to hide data on a hard disk. In this case a disk editor utility is used to access the hidden data in the partition gap.</span>
4 0
3 years ago
Read 2 more answers
Which of the following functions needed to implement the information security program evaluates patches used to close software v
solong [7]

Answer:

a. Systems testing

Explanation:

According to my research on information technology, I can say that based on the information provided within the question the term being defined is called System Testing. Like mentioned in the question, this is a technique used in order to evaluate the complete system the system's compliance against specified requirements, which tests its functionalities from an end-to-end perspective in order to evaluates patches used to close software vulnerabilities and make sure it complies with all policies.

I hope this answered your question. If you have any more questions feel free to ask away at Brainly.

6 0
3 years ago
This diagram shows some peripheral devices for a computer: which of the following is true
CaHeK987 [17]

Where is the diagram and answers?

4 0
3 years ago
Other questions:
  • Why is it critical to provide proper treatment for minor and moderate sports injuries within the first 48 hours after sustaining
    14·1 answer
  • Cpu, ram, rom, and other electronic components are mounted on a board, which is called the
    15·1 answer
  • Develop a Python module that will prompt the user for a target sum that is greater than 0 and less than 1 for the following Geom
    13·1 answer
  • Should i change my profile pic<br> dont delete
    15·2 answers
  • 30 points!! What should I do if I plug my computer in and it starts making noises and sounds and it starts smelling.
    9·1 answer
  • A virus that is embedded in the automatically executing scipts commonly found in word processors, spreadsheets, and database app
    13·2 answers
  • Which type of computer network ensures high security
    10·1 answer
  • Is an applications program is a program designed to perform a specific task for specific users
    5·1 answer
  • In this class, it is very common for your computer screen to look like this. What is this?​
    5·1 answer
  • Wake up to reality. Nothing ever goes as planned in this world. The longer you live,the more you realize that only pain, sufferi
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!