   Chapter 9.2, Problem 24ES ### Discrete Mathematics With Applicat...

5th Edition
EPP + 1 other
ISBN: 9781337694193

#### Solutions

Chapter
Section ### Discrete Mathematics With Applicat...

5th Edition
EPP + 1 other
ISBN: 9781337694193
Textbook Problem
1 views

# In each of 24—28, determine how many times the innermost loop will be iterated when the algorithm segment is implemented and run. (Assume that m, n, p, a, b, c, and d are all positive integers.) 24. for i : = 1 to 30 for j : = 1 to 15 [Statements in body of inner loop. None contain branching statements that lead outside the ioop.] next j next i

To determine

The number of times that the innermost loop will be iterated when the algorithm segment is implemented and run.

for i:=1to 30for j:=1to 15

[Statements in body of inner loop. None contain branching statements that lead outside the loop.]

next jnext i

Explanation

Given information:

Algorithm segment is implemented and run.

Concept used:

for i:=1to 30for j:=1to 15

[Statements in body of inner loop. None contain branching statements that lead outside the loop.]

next jnext i

Calculation:

Consider the algorithm below:

for i:=1to 30for j:=1to 15

next jnext i

The objective is to determine the number of times the innermost loop will be iterated when the algorithm segment is implemented and run.

The outer loop is iterated 30 times and during each iteration of the outer loop, there are 15 iterations of the inner loop

### Still sussing out bartleby?

Check out a sample textbook solution.

See a sample solution

#### The Solution to Your Study Problems

Bartleby provides explanations to thousands of textbook problems written by our experts, many with advanced degrees!

Get Started 