Dear ALL,

Could you tell me how can I do this kind of question if I do not working with the computer and please find the attached document for your reference - it is the answer of the question?

Complete the table below to show what each variable holds, the user enters the numbers 5, 6, 7, 8, 9

evens:=0;
for count:= 1 to 5 do
    begin
      writeln('Please enter a number');
      readln(numbers[count]);
      if (numbers[count] mod 2 = 0) then
	begin
	  evens := evens + 1;
	end
    end;
writeln(evens);

Recommended Answers

All 4 Replies

It is the attached document.

The way I read this, is that you need to calculate the value of the variable (evens). Just follow the source code in your head, or on paper, and do as it instructs.

I don't see output in the code, so I'm not sure what they mean by that.

Thank you for your prompt reply. Yes, I want to calculate the value of the variable (evens). Just follow the source code in my head, or on paper. But how can I do in this way?

Maybe, it is not useful for me to work on the computer for this kind of question.

Try it on paper. Write the values down. Then change them as you walk through each loop (in your head).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.