6 שיעור 
						   
function   procedure   parameter:actual parameter, formal parameter

function TAN(x:real):real;
begin
  tan:=sin(x)/cos(x)
end

y:=tan(30);
height:=range*tan(elevation);
write(tan(degress*pi/180));

program tantable;
const pi=22/7;
var deg:integer;
function TAN(x:real):real;
begin
  tan:=sin(x)/cos(x)
end;
begin
  writeln('DEGREES','TANGENT');
  writeln('-------','-------');
  for deg:= 0 to 36 do
    writeln(deg*10,tan(deg*10*pi/180))
end.

----------------------------------------------------------------------------

program exponent;
const pi=3.14159;
var  spi:real;
(*************************************************************************)
function power(x:real; y:integer):real;
{This function computes   x**y; it assumes y>=0. }
var z:real;
begin
  z:=1;
  while y>0 do
  begin
    while not odd(y) do
    begin
      y:=y div 2;  x:=sqr(x)
    end;
    y:=y-1;  z:=x*z
  end;
  power:=z
end;
(*************************************************************************)
begin
  writeln(2.0,'   ',7,power(2.0,7));
  spi:=power(pi,2);
  writeln(pi,'   ',2,spi);
  writeln(spi,'   ',2,power(spi,2));
  writeln(pi,'   ',4,power(pi,4))
end.


1) program Bars;                          2) program Exchange;
   const DollarSign='$';                     var Little, Big:integer;
   var Income:integer;                       procedure Switch
       Symbol:char;                            (var First, Second:integer);
   procedure DrawBar(Length:integer;         var Temp:integer;
     BarCharacter:char);                     begin
   var Counter:integer;                        Temp:=First;
   begin                                       First:=Sec;
     for Counter:=1 to Length do               Sec:=Temp
       write(BarCharacter);                  end;  { Switch }
     writeln                                 begin
   end;   { DrawBar }                          Big:=5;  Little:=10;
   begin                                       writeln(Big,Little);
     Income:=20;  Symbol:='#';                 Switch(Big,Little);
     DrawBar(12, 'X');                         writeln(Big,Little)
     DrawBar(3*5, Symbol);                   end.  { Exchange }
     DrawBar(Income, DollarSign);   
   end.       
	                                          5     10
                                                 10      5
   XXXXXXXXXXXX
   ###############                     
   $$$$$$$$$$$$$$$$$$$$                3) procedure AddUp(First,Second:integer;
                                                       var Sum:integer);
   DrawBar(trunc(sqrt(Error)),chr(45));   begin
   DrawBar(10+correction,InputChar);        Sum:=First+Second
   DrawBar(CommaNum,',');                 end;

   4) program Dugma;                        5) program Confusion;
      const limit=25;                          var a,b,c,d:integer;
      type Ltype=array[1..limit] of integer;   procedure Confuse(a,b:integer);
      var alist:Ltype;                         var c:integer;
          i:integer;                           begin
      (*************************************)    a:=5; b:=6; c:=7; d:=8;
      procedure Switch(var First,Sec:integer);   writeln(a,b,c,d)
      var temp:integer;                        end;   {  Confuse  }
      begin                                    begin
        temp:=first; first:=sec; sec:=temp       a:=1; b:=2; c:=3; d:=4;
      end;                                       writeln(a,b,c,d);
      (*************************************)    confuse(a,b);
      procedure Bubble(num:integer;              writeln(a,b,c,d)
                 var list:ltype);              end.
      var chiluf:boolean; tmp,j:integer;
      begin                                     1   2   3   4
        chiluf:=true;                           5   6   7   8
        while chiluf do                         1   2   3   8
        begin
          chiluf:=false;           6) procedure Bad(a:integer;  var b:integer);
          for j:=1 to 24 do                     var a:integer;  b:real;
            if list[j]>list[j+1]
              then begin
                     switch(list[j],list[j+1]);
                     chiluf:=true
                   end
        end
      end;
      (****************************************)
      begin
        for i:=1 to limit do     readln(alist[i]);
        bubble(limit, alist);
        for i:=1 to limit do     writeln(alist[i])                
      end.