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 thatj
B) j is an integer such thatjnandprod=nj.
C) j is an integer such thatj
D) j is an integer such thatjnandprod=mj
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
