Лице и обиколка на кръг

Да се напише програма, съдържаща функции за пресмятане на лице и обиколка на кръг.

Публикувано в с етикети . Постоянна връзка.

8 коментара по Лице и обиколка на кръг

  1. Боряна каза:
    program Project1;
    function Lice(r:real):real;
    begin
    Result:=r*r*3.14;
    end;
    function Obikolka(r:real):real;
    begin
    Result:=r*2*3.14;
    end;
    var
      r: real;
    begin
      Write('Vavedete radius na krag:');
      ReadLn(r);
      WriteLn('Liceto na krag s takav radius e ', Lice(r):0:2);
      WriteLn('Dalginata na krag s takav radius e ', Obikolka(r):0:2);
      ReadLn;
    end.  
    
  2. Alya каза:
    program project1;
    
    function ObikolkaKrag(R:real):real;
    begin
      Result:= 2*R*3.14;
    end;
    function LiceKrag(R:real):real;
    begin
      Result:=3.14*R*R;
    end;
    var
      S,C,R:real;
    begin
      Write('Vavedete radius: ');
      ReadLn(R);
      C:= ObikolkaKrag(R);
      WriteLn('Obikolkata e:',C);
      S:= LiceKrag(R);
      WriteLn('Liceto e:',S);
      Readln;
    end.   
      
  3. viktoria каза:
    program Krag;
       function LiceKrag(r:real):real;
        var S:real;
        const pi=3.14 ;
       begin
        Result:=pi*r*r ;
       end;
    
      function ObikolkaKrag(r:real):real;
       var P:real;
       const pi=3.14;
      begin
       Result:=2*pi*r;
       end;
    var P,S,r:real;
    begin
      ReadLn(r);
      S:=LiceKrag(r);
      P:=ObikolkaKrag(r);
      WriteLn ('Liceto e: ',S:5:2);
      WriteLn ('Obkolkata e: ',P:5:2);
      ReadLn;
    end. 
    
  4. Виктория каза:
     
    program Project1;
    
    function LiceKrug(r: real):real;
    var
      S: real;
      const pi=3.14;
    begin
      Result:= pi*r*r;
    end;
    
    function ObikolkaKrug(r: real): real;
    var
      P: real;
      const pi=3.14;
    begin
      Result:= 2*pi*r;
    end;
    
    var
      S, P, r: real;
    begin
      Write('Vavedete r: ');
      ReadLn(r);
      P:=ObikolkaKrug(r);
      S:=LiceKrug(r);
      WriteLn('Liceto e: ',S :5:2);
      WriteLn('Obikolkata e: ',P :5:2);
      ReadLn;
    end. 
    
  5. Lubomira каза:
    program krug;
    
    function liceKrug(r:real):real;
    begin
    Result := pi*r*r ;
    end;
    
    function ObikolkaKrug(r:real):real ;
    begin
    Result:= 2*pi*r   ;
    end ;
    
    const
      pi=3.14  ;
    
    var
      P,S,r :real ;
    
    begin
    WriteLn('Vuvedete radius:') ;
    ReadLn(r) ;
    S:= LiceKrug(r) ;
    P:= ObikolkaKrug(r) ;
    WriteLn ('Liceto e : ',S:5:2) ;
    WriteLn ('Obikolkata e : ' ,P :5:2);
    ReadLn ;
    end.
    
                                                   
  6. Tsvetelin каза:
    program Project1;
    
    var S,R,P:Real;
    
    function ObikolkaKrug(R:Real):Real;
      const pi=3.14;
    begin
      Result:=2*pi*R;
    end;
    
    function LiceKrug(R:Real):Real;
      const pi=3.14;
    begin
      Result:=pi*R*R;
    end;
    
    begin
    Write('Enter R:');
    ReadLn(R);
    P:=ObikolkaKrug(R);
    S:=LiceKrug(R);
    WriteLn('P=',P:6:1);
    WriteLn('S=',S:6:1);
    ReadLn;
    end.
    

Вашият коментар