Use summations to determine the number of print statements run in the following pseudocode. i = 1 while i <= n: j := 1 while j <= i: print "hello" j := j + 1 i = i + 1

Algebra & Trigonometry with Analytic Geometry
13th Edition
ISBN:9781133382119
Author:Swokowski
Publisher:Swokowski
Chapter1: Fundamental Concepts Of Algebra
Section1.1: Real Numbers
Problem 30E
icon
Related questions
Question

very confused can you please explain how to solve this to end up with a solution of n(n+1)/2 

Use summations to determine the number of print statements run in the following pseudocode.
i := 1
while i <= n:
j := 1
while j <= i:
print "hello"
j := j + 1
i := i + 1
Transcribed Image Text:Use summations to determine the number of print statements run in the following pseudocode. i := 1 while i <= n: j := 1 while j <= i: print "hello" j := j + 1 i := i + 1
Expert Solution
steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Recommended textbooks for you
Algebra & Trigonometry with Analytic Geometry
Algebra & Trigonometry with Analytic Geometry
Algebra
ISBN:
9781133382119
Author:
Swokowski
Publisher:
Cengage
Algebra: Structure And Method, Book 1
Algebra: Structure And Method, Book 1
Algebra
ISBN:
9780395977224
Author:
Richard G. Brown, Mary P. Dolciani, Robert H. Sorgenfrey, William L. Cole
Publisher:
McDougal Littell
College Algebra
College Algebra
Algebra
ISBN:
9781305115545
Author:
James Stewart, Lothar Redlin, Saleem Watson
Publisher:
Cengage Learning
College Algebra (MindTap Course List)
College Algebra (MindTap Course List)
Algebra
ISBN:
9781305652231
Author:
R. David Gustafson, Jeff Hughes
Publisher:
Cengage Learning
Intermediate Algebra
Intermediate Algebra
Algebra
ISBN:
9780998625720
Author:
Lynn Marecek
Publisher:
OpenStax College
College Algebra
College Algebra
Algebra
ISBN:
9781337282291
Author:
Ron Larson
Publisher:
Cengage Learning