Question: The loop below computes the product of two integers: While (j < n) prod := prod + m j := j + 1 End-while The

The loop below computes the product of two integers:

While (j < n)

prod := prod + m

j := j + 1

End-while

The pre-condition and post-condition for the loop are:

Pre-condition: m and n are non-negative integers. j = 0 and prod = 0.

Post-condition:.

What is the correct loop condition?

A) j is an integer such thatjandprod=mj

B) j is an integer such thatjnandprod=nj.

C) j is an integer such thatjandprod=nj

D) j is an integer such thatjnandprod=mj

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 Mathematics Questions!