223 views
0 votes
0 votes
function mu(a,b:integer) returns integer;
var i,y: integer;
begin
---------P----------
i = 0; y = 0;
while (i < a) do
begin --------Q------------
y := y + b ;
i = i + 1
end
return y
end
Write a condition P such that the program terminates, and a condition Q which is
true whenever program execution reaches the place marked Q above.

Please log in or register to answer this question.

Related questions

1 votes
1 votes
1 answer
3
sripo asked Feb 15, 2019
425 views
How many subsets of even cardinality does an n-element set have ? Justify answer.Please give a proof if possible.This is part of subjective JEST paper.
0 votes
0 votes
0 answers
4
sahadebmandal asked Jan 17, 2019
305 views
function AP(x,y: integer) returns integer;if x = 0 then return y+1else if y = 0 then return AP(x-1,1)else return AP(x-1, AP(x,y-1))(a) Show that on all nonnegative argume...