Quantcast
Channel: Programmers Heaven Forums RSS Feed
Viewing all articles
Browse latest Browse all 2703

Pascal programming exam exercise

$
0
0
Hey, i have to write an exam and here is an example of the actual exam exercise, can someone please explain me how it works and how i'm supposed to do it. Below the code there is a table where the empty spots needs to be filled in order to complete the exercise.

Thanks.

uses unit01;
var
I, j, k : integer;
begin
i:=11; j:=22; k:=33;
writeln(‘ zero ‘, a:3, b:3, c:3, i:3, j:3, k:3);
read (a, b, c);
writeln(‘ one ‘, a:3, b:3, c:3, i:3, j:3, k:3);
i:=funun1 (a, b, c);
writeln(‘ four ‘, a:3, b:3, c:3, i:3, j:3, k:3);
end.

unit unit01;

interface
var
i, j, k, a, b, c : integer;
function funun1 (var a, b, c: integer) : integer;
implementation
function funun1 (var a, b, c: integer) : integer;
var j :integer;
begin
j:=0;
writeln(‘ two ‘, a:3, b:3, c:3, i:3, j:3, k:3);
c:=a+b+c;
j:=a+b;
j:=j+c;
funun1:=j;
writeln(‘ three ‘, a:3, b:3, c:3, i:3, j:3, k:3);
end;

begin
a:=10; b:=20; c:=30;
i:=111; j:=222; k:=333;
end.



Viewing all articles
Browse latest Browse all 2703

Trending Articles