October 2018 1 73 Report

Witam.

Potrzebuję dokładne opisuje jak działa funkcja i procedura w programcie Turbo Pascal. Dzisiaj na lekcji napisaliśmy taki przykładowo program:

var

a,b:integer;

function NWD(a,b:integer):integer;

var

pom:integer;

begin

while (a<>b) do

begin

if a<b then

begin

pom:=a; a:=b; b:=pom;

end;

a:=a-b;

end;

NWD:=a;

end;

begin

writeln('Podaj liczby...');

readln(a,b);

writeln('NWD(',a,',',b,') = ',NWD(a,b));

NWD(a,b);

readln;

end.

Oczekuję, że ktoś mi wytłumaczy, po kolei, krok po kroku jak działa funkcja w TP.


More Questions From This User See All

Recommend Questions



Life Enjoy

" Life is not a problem to be solved but a reality to be experienced! "

Get in touch

Social

© Copyright 2013 - 2024 KUDO.TIPS - All rights reserved.