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 40E
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
Elements Of Modern Algebra
Elements Of Modern Algebra
Algebra
ISBN:
9781285463230
Author:
Gilbert, Linda, Jimmie
Publisher:
Cengage Learning,
College Algebra
College Algebra
Algebra
ISBN:
9781337282291
Author:
Ron Larson
Publisher:
Cengage Learning