Question: given the code below, answer the following the questions: 1 for i in 1 . . n loop 2 for j in 1 . .

given the code below, answer the following the questions: 1 for i in 1..n loop 2 for j in 1..i loop 3 for k in i..j loop 4 sum := sum +1; 5 end loop; 6 end loop; 7 end loop; 8 for p in 1..n*n loop 9 for q in 1..p loop 10 sum := sum -1; 11 end loop; 12 end loop; (a) how many times is statement 4 executed?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!