## Pascal

Moderators: None (Apply to moderate this forum)
Number of posts: 14004

This Forum Only

Pascal programming exam exercise Posted by dizels on 28 Nov 2012 at 1:45 PM
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);
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.

## Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic