CSE503: Software Engineering
Lecture 20 (February 24, 1999)

David Notkin

read(n)
i := 1;
sum := 0;
product := 1;
while i <= n do begin
sum := sum + i;
product := product * i;
i := i + 1;
end;
write(sum);
write(product);

read(n)
i := 1;

product := 1;
while i <= n do begin
product := product * i;
i := i + 1;
end;
write(product);