Pascal

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

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
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);
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.





 

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
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.