program tati;
var
x, y, z: integer;
procedure tata (a: integer; var b: integer);
begin
a := a + 1; {
Les modifications de 'a' sont locales }
b := 2 * b + a;
{ les
modifications de b sont 'globales', elles sont sauvegarde
quand la fonctiona finie d'être execute }
end;
procedure titi (a: integer; var b, c: integer);
begin
tata(b, a); {
'b' n'est pas modifié a est modifié }
c := c + b - 6;
{ c est
modifié et le mofications sont sauvegarde. }
writeln('titi : a= ', a : 0, 'b=
', b : 0, 'c= ', c : 0);
{ a n'est pas
change, le modofications de b et c sont sauvegarde }
end;
begin
writeln('Exercice 1 http://www.Software-DS.com');
x := 4;
y := 1;
z := 2;
writeln('x= ', x : 0, ' y= ', y : 0, ' z= ', z : 0);
titi(x, y, z);
writeln('x= ', x : 0, ' y= ', y : 0, ' z= ', z : 0);
titi(x, y, z);
writeln('x= ', x : 0, ' y= ', y : 0, ' z= ', z : 0);
titi(x, y, z);
writeln('x= ', x : 0, ' y= ', y : 0, ' z= ', z : 0);
writeln;
writeln('©2001 All Rights Reserved to
www.Software-DS.com');
{ ©2001 All
Rights Reserved to http://www.Software-DS.com
30/10/01 }
end.
|