SlideShare a Scribd company logo
Prog_2 course- 2014 
2 bytes team 
Kinan keshkeh 
IT Engineering-Damascus University 
3rd year
Units
Why units ?
Introduction 
How is the compilation process ?? 
the principle of compilation is based on fragmentation the program into several files then the compiler compile 
each file separately then Connect all parts of the compiled to configure executable file (conversion program form machine language to “code” language )
Unit stop here 
compilation 
source file in Pascal language 
Text files for some procedure or function 
Unit programing ready to use 
Libraries ready to use 
linked 
Execution
unit 
Unit unitname 
Interface 
Implementation 
Definition : 
Uses 
Const 
Type 
Var 
The header of procedure or function 
Uses 
Const 
Type 
Var 
The object of procedure or function founded in interface part 
End. 
After last end we have to put (.) not (;) 
Unit divided into two sections : 
1) Interface : 
2) Implementation :
Interface : or what we call it <<public part>> , in this part we can define the visible things to any program or another unit for example : 
Uses wincrt; 
Const pi=3.14; 
Type arr=array[1..100] of integer; 
var x:integer; 
Function sum(x,y:integer):integer; 
Function max(a,b:integer):integer; 
Note: include interface part we only define the header of procedure or function
Implementation : or what we call it <<private part>> in this part we can define invisible things, we can‟t deal with them when we go out from the definition of the unit 
Uses wincrt; 
Const max=100; 
Type person=record 
fname,lname:string; 
end; 
var c:char ; 
Function sum(x,y:integer): integer; 
Begin 
Sum:=x+y; 
end; 
Function max(a,b:integer):integer; 
Begin 
if (a > b) then 
Max:=a; 
Else 
Max:=b; 
end;
After writing unit what do we have to do ? 
1.Correct the errors, if any 
2.Compilation 
3.Save this file under unit‟s name with (TPU) <<unitname.TPU>> 
For example : 
Unit my_unit; 
Save as:<<my_unit.TPU>> 
4.Recall this unit in main program using 
reserved word (uses) 
uses my_unit ; 
Note : unit is subprogram unexecutable we cannot run it ……
Unit my_unit1; 
Interface 
Const val=200; 
Var w : integer ; 
procedure swap(var x,y:integer); 
Implementation 
var temp :integer ; 
procedure swap(var x,y:integer); 
begin 
temp:=x; 
x:=y; 
y:=temp; 
end; 
End. 
Compilation 
Attention !!!
Unit my_unit1; 
Interface 
Const val=200; 
Var w : integer ; 
procedure swap(var x,y:integer); 
Implementation 
var temp :integer ; 
readln(x); 
procedure swap(var x,y:integer); 
begin 
temp:=x; 
x:=y; 
y:=temp; 
end; 
End. 
{false} 
There is no Instructions in unit
Program prog1; 
Uses my_unit1; 
Var a,b :integer; 
Begin 
w:=5; temp:=10; a:=2; b:=3; 
End. 
{true} 
{false} 
a= 3 
b= 2 
swap(a,b); 
Writeln(„a= „,a); 
Writeln(„b= „,b); 
w,b); 
w= „,w); 
w= 5
Program prog1; 
Uses my_unit1; 
Var a,b,w :integer; 
Begin 
w:=5; temp:=10; a:=2; b:=3; 
End. 
swap(w,b); 
Writeln(„w= „,w); 
Writeln(„b= „,b); 
My_unit1.w 
If you want to deal with w in my_unit 
You should write 
Which w ???? 
{this} 
my_unit1.w:=10
Lets make it real :D !!
Exercise : 
أنشئ وحذة بشهج تٍ وعشف ف هٍا تابع قٌىم بحساب ) a^n ( وإجشائ تٍ 
تقىم بحساب هعكىس عذد طب عٍ وإجشائ تٍ تقىم بطباعت عناصش سلسلت 
أحاد تٌ بشكل هعكىس )هن النها تٌ حتى البذا تٌ ( ) على أن تتن كتابت 
الإجشائ اٍث السابقت بشكل عىدي ( ثن استخذم هزه الىحذة ف بشناهج 
سئ سٍ ورلك لاستذعاء التىابع السابقت
Recursion 
It‟s process that procedure or function recall itself within the body of that procedure or function 
 Recursion always need to stop condition
Unit recursion_unit; 
Interface 
type list=^node; 
node=record 
value:integer; 
next : list; 
end; 
Function y(a,n:integer): longint ; 
Procedure reverse(z:integer ; var z1:integer); 
Procedure printlist (p: list ); 
Implementation 
Function y(a,n:integer): longint ; 
Begin 
If n=0 then 
y:=1 
else 
y:=y(a,n-1)*a; 
end;
Procedure reverse(z:integer ;var z1:integer); 
Begin 
If (z<>0) then 
begin 
Z1:=z1*10 + z mod 10; 
Reverse (z div 10 , z1); 
end; 
end; 
Procedure printlist(p : list ); 
Begin 
If (p^.next <> nil ) then 
Printlist(p^.next); 
Write(p^.value:5); 
end; 
End.
Program pro2bytes_team; 
uses recursion_unit; 
var a,n,z,z1,m,x,i:integer; 
p,temp:list; 
Begin 
Readln(a,n); 
If (n < 0) then 
Writeln(„a^n = „,1/y(a,n)) 
Else 
Writeln(„a^n = „,y(a,n)); 
Writeln(„ input positive number „); 
Readln(z); 
z1:=0; 
Reverse (z,z1); 
Writeln(„z1 = „,z1);
Writeln(„input the number of nodes „); 
Readln(m); 
Writeln(„input the value „); 
Readln(x); 
new(p); 
p^.value:=x; 
temp:=p; 
for i:=2 to m do 
begin 
new(temp^.next) ; 
temp:=temp^.next; 
Writeln(„input the value „); 
Readln(x); 
temp^.value:=x; 
end; 
temp^.next:=nil; 
Printlist(p); 
End.
Execution : 
Function y(a,n:integer): longint ; 
Begin 
If n=0 then 
y:=1 
else 
y:=y(a,n-1)*a; 
end; 
n=3 
a=2 
a = 
n 
y= * 2 
n= 3 
n= 2 
n= 1 
n= 0 
y= * 2 
y= * 2 
y = 1 
waiting 
waiting 
waiting 
stop condition 
8 
4 
2 
1 
End.
Procedure printlist(p : list ); 
Begin 
If (p^.next <> nil ) then 
Printlist(p^.next); 
Write(p^.value:5); 
end; 
End. 
Execution : 
next 
20 
15 
10 
5 
p 
nil 
p 
p 
p 
stop condition !!! 
output 
20 
15 
10 
5
Group : group link 
Mobile phone- Kinan : 0994385748 
Facebook account : kinan’s account 
2 bytes team

More Related Content

What's hot (20)

PPTX
Loops in R
Chris Orwa
 
PDF
Kumpulan contoh-program-pascal
rey25
 
PPTX
Loop control in c++
Debre Tabor University
 
PDF
array, function, pointer, pattern matching
Shakila Mahjabin
 
PDF
A "Do-It-Yourself" Specification Language with BeepBeep 3 (Talk @ Dagstuhl 2017)
Sylvain Hallé
 
PPTX
Do...while loop structure
Jd Mercado
 
PPT
C++ programming
viancagerone
 
PPTX
Javascript function
LearningTech
 
PDF
TDD - Test Driven Development in Swift (iOS) with Cuckoo, Quick and Nimble
Jianbin LIN
 
PPTX
C++ Programming Club-Lecture 3
Ammara Javed
 
DOC
Slide07 repetitions
altwirqi
 
PPTX
parallel programming in the PVM- task creation-Advanced system architecture
RoslinJoseph
 
PPTX
C++ Programming Club-Lecture 2
Ammara Javed
 
PPTX
C++ Programming Club-Lecture 1
Ammara Javed
 
PDF
BeepBeep 3: A declarative event stream query engine (EDOC 2015)
Sylvain Hallé
 
PPTX
.NET Core Summer event 2019 in Brno, CZ - Async demystified -- Karel Zikmund
Karel Zikmund
 
PPTX
Python Programming Essentials - M17 - Functions
P3 InfoTech Solutions Pvt. Ltd.
 
PPT
functions
teach4uin
 
DOCX
applet.docx
nofakeNews
 
PPTX
Javascript Function
xxbeta
 
Loops in R
Chris Orwa
 
Kumpulan contoh-program-pascal
rey25
 
Loop control in c++
Debre Tabor University
 
array, function, pointer, pattern matching
Shakila Mahjabin
 
A "Do-It-Yourself" Specification Language with BeepBeep 3 (Talk @ Dagstuhl 2017)
Sylvain Hallé
 
Do...while loop structure
Jd Mercado
 
C++ programming
viancagerone
 
Javascript function
LearningTech
 
TDD - Test Driven Development in Swift (iOS) with Cuckoo, Quick and Nimble
Jianbin LIN
 
C++ Programming Club-Lecture 3
Ammara Javed
 
Slide07 repetitions
altwirqi
 
parallel programming in the PVM- task creation-Advanced system architecture
RoslinJoseph
 
C++ Programming Club-Lecture 2
Ammara Javed
 
C++ Programming Club-Lecture 1
Ammara Javed
 
BeepBeep 3: A declarative event stream query engine (EDOC 2015)
Sylvain Hallé
 
.NET Core Summer event 2019 in Brno, CZ - Async demystified -- Karel Zikmund
Karel Zikmund
 
Python Programming Essentials - M17 - Functions
P3 InfoTech Solutions Pvt. Ltd.
 
functions
teach4uin
 
applet.docx
nofakeNews
 
Javascript Function
xxbeta
 

Similar to 2Bytesprog2 course_2014_c8_units (20)

PDF
2Bytesprog2 course_2014_c1_sets
kinan keshkeh
 
PDF
2Bytesprog2 course_2014_c1_sets
kinan keshkeh
 
PPTX
Problem Solving PPT Slides Grade 10- 11students
chamm5
 
PPT
Cs341
Serghei Urban
 
PPT
Basic_analysis.ppt
SoumyaJ3
 
PPT
chapter1.ppt
ebinazer1
 
PPT
chapter1.ppt
SankarTerli
 
PPT
chapter1.ppt
chetanvchaudhari
 
PDF
2Bytesprog2 course_2014_c5_pointers
kinan keshkeh
 
PDF
PSP LAB MANUAL.pdf
Selvaraj Seerangan
 
DOCX
COMP 122 Entire Course NEW
shyamuopeight
 
PPTX
Advanced procedures in assembly language Full chapter ppt
Muhammad Sikandar Mustafa
 
PDF
SOLUTION MANUAL OF COMPUTER ORGANIZATION BY CARL HAMACHER, ZVONKO VRANESIC & ...
vtunotesbysree
 
PDF
Function procedure c6 c7
Omar Al-Sabek
 
PPT
Course1
Constantin Nicolae
 
PPTX
unsplitted slideshare
Daniel Gomez-Prado
 
PDF
Algorithm Design: Optimization using recursion.
Ferry Kemperman
 
PPT
recursion.ppt
gilvalerio
 
PDF
Chapter VII RECURSION.pdf algor and data structure
benyakoubrania53
 
PPT
lec_4_data_structures_and_algorithm_analysis.ppt
SourabhPal46
 
2Bytesprog2 course_2014_c1_sets
kinan keshkeh
 
2Bytesprog2 course_2014_c1_sets
kinan keshkeh
 
Problem Solving PPT Slides Grade 10- 11students
chamm5
 
Basic_analysis.ppt
SoumyaJ3
 
chapter1.ppt
ebinazer1
 
chapter1.ppt
SankarTerli
 
chapter1.ppt
chetanvchaudhari
 
2Bytesprog2 course_2014_c5_pointers
kinan keshkeh
 
PSP LAB MANUAL.pdf
Selvaraj Seerangan
 
COMP 122 Entire Course NEW
shyamuopeight
 
Advanced procedures in assembly language Full chapter ppt
Muhammad Sikandar Mustafa
 
SOLUTION MANUAL OF COMPUTER ORGANIZATION BY CARL HAMACHER, ZVONKO VRANESIC & ...
vtunotesbysree
 
Function procedure c6 c7
Omar Al-Sabek
 
unsplitted slideshare
Daniel Gomez-Prado
 
Algorithm Design: Optimization using recursion.
Ferry Kemperman
 
recursion.ppt
gilvalerio
 
Chapter VII RECURSION.pdf algor and data structure
benyakoubrania53
 
lec_4_data_structures_and_algorithm_analysis.ppt
SourabhPal46
 
Ad

More from kinan keshkeh (20)

PDF
10 Little Tricks to Get Your Class’s Attention (and Hold It)
kinan keshkeh
 
PDF
Simpson and lagranje dalambair math methods
kinan keshkeh
 
PDF
Shapes and calculate (area and contour) / C++ oop concept
kinan keshkeh
 
PDF
Shapes and calculate (area and contour) / C++ oop concept
kinan keshkeh
 
PDF
GeneticAlgorithms_AND_CuttingWoodAlgorithm
kinan keshkeh
 
PDF
Algorithm in discovering and correcting words errors in a dictionary or any w...
kinan keshkeh
 
PDF
2Bytesprog2 course_2014_c9_graph
kinan keshkeh
 
PDF
2Bytesprog2 course_2014_c7_double_lists
kinan keshkeh
 
PDF
2Bytesprog2 course_2014_c6_single linked list
kinan keshkeh
 
PDF
2Bytesprog2 course_2014_c4_binaryfiles
kinan keshkeh
 
PDF
2Bytesprog2 course_2014_c3_txtfiles
kinan keshkeh
 
PDF
2Bytesprog2 course_2014_c2_records
kinan keshkeh
 
PDF
2Bytesprog2 course_2014_c1_sets
kinan keshkeh
 
PDF
2Bytesprog2 course_2014_c1_sets
kinan keshkeh
 
PDF
2 BytesC++ course_2014_c13_ templates
kinan keshkeh
 
PDF
2 BytesC++ course_2014_c12_ polymorphism
kinan keshkeh
 
PDF
2 BytesC++ course_2014_c11_ inheritance
kinan keshkeh
 
PDF
2 BytesC++ course_2014_c10_ separate compilation and namespaces
kinan keshkeh
 
PDF
2 BytesC++ course_2014_c9_ pointers and dynamic arrays
kinan keshkeh
 
PDF
2 BytesC++ course_2014_c8_ strings
kinan keshkeh
 
10 Little Tricks to Get Your Class’s Attention (and Hold It)
kinan keshkeh
 
Simpson and lagranje dalambair math methods
kinan keshkeh
 
Shapes and calculate (area and contour) / C++ oop concept
kinan keshkeh
 
Shapes and calculate (area and contour) / C++ oop concept
kinan keshkeh
 
GeneticAlgorithms_AND_CuttingWoodAlgorithm
kinan keshkeh
 
Algorithm in discovering and correcting words errors in a dictionary or any w...
kinan keshkeh
 
2Bytesprog2 course_2014_c9_graph
kinan keshkeh
 
2Bytesprog2 course_2014_c7_double_lists
kinan keshkeh
 
2Bytesprog2 course_2014_c6_single linked list
kinan keshkeh
 
2Bytesprog2 course_2014_c4_binaryfiles
kinan keshkeh
 
2Bytesprog2 course_2014_c3_txtfiles
kinan keshkeh
 
2Bytesprog2 course_2014_c2_records
kinan keshkeh
 
2Bytesprog2 course_2014_c1_sets
kinan keshkeh
 
2Bytesprog2 course_2014_c1_sets
kinan keshkeh
 
2 BytesC++ course_2014_c13_ templates
kinan keshkeh
 
2 BytesC++ course_2014_c12_ polymorphism
kinan keshkeh
 
2 BytesC++ course_2014_c11_ inheritance
kinan keshkeh
 
2 BytesC++ course_2014_c10_ separate compilation and namespaces
kinan keshkeh
 
2 BytesC++ course_2014_c9_ pointers and dynamic arrays
kinan keshkeh
 
2 BytesC++ course_2014_c8_ strings
kinan keshkeh
 
Ad

Recently uploaded (20)

PPTX
Milwaukee Marketo User Group - Summer Road Trip: Mapping and Personalizing Yo...
bbedford2
 
PPTX
Transforming Mining & Engineering Operations with Odoo ERP | Streamline Proje...
SatishKumar2651
 
PDF
SAP Firmaya İade ABAB Kodları - ABAB ile yazılmıl hazır kod örneği
Salih Küçük
 
PDF
SciPy 2025 - Packaging a Scientific Python Project
Henry Schreiner
 
PDF
TheFutureIsDynamic-BoxLang witch Luis Majano.pdf
Ortus Solutions, Corp
 
PPTX
Help for Correlations in IBM SPSS Statistics.pptx
Version 1 Analytics
 
PDF
Build It, Buy It, or Already Got It? Make Smarter Martech Decisions
bbedford2
 
PDF
Empower Your Tech Vision- Why Businesses Prefer to Hire Remote Developers fro...
logixshapers59
 
PDF
How to Hire AI Developers_ Step-by-Step Guide in 2025.pdf
DianApps Technologies
 
PPTX
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
PDF
4K Video Downloader Plus Pro Crack for MacOS New Download 2025
bashirkhan333g
 
PDF
HiHelloHR – Simplify HR Operations for Modern Workplaces
HiHelloHR
 
PPTX
ChiSquare Procedure in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PPTX
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
PDF
유니티에서 Burst Compiler+ThreadedJobs+SIMD 적용사례
Seongdae Kim
 
PPTX
Home Care Tools: Benefits, features and more
Third Rock Techkno
 
PDF
Open Chain Q2 Steering Committee Meeting - 2025-06-25
Shane Coughlan
 
PDF
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
PPTX
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
PDF
Download Canva Pro 2025 PC Crack Full Latest Version
bashirkhan333g
 
Milwaukee Marketo User Group - Summer Road Trip: Mapping and Personalizing Yo...
bbedford2
 
Transforming Mining & Engineering Operations with Odoo ERP | Streamline Proje...
SatishKumar2651
 
SAP Firmaya İade ABAB Kodları - ABAB ile yazılmıl hazır kod örneği
Salih Küçük
 
SciPy 2025 - Packaging a Scientific Python Project
Henry Schreiner
 
TheFutureIsDynamic-BoxLang witch Luis Majano.pdf
Ortus Solutions, Corp
 
Help for Correlations in IBM SPSS Statistics.pptx
Version 1 Analytics
 
Build It, Buy It, or Already Got It? Make Smarter Martech Decisions
bbedford2
 
Empower Your Tech Vision- Why Businesses Prefer to Hire Remote Developers fro...
logixshapers59
 
How to Hire AI Developers_ Step-by-Step Guide in 2025.pdf
DianApps Technologies
 
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
4K Video Downloader Plus Pro Crack for MacOS New Download 2025
bashirkhan333g
 
HiHelloHR – Simplify HR Operations for Modern Workplaces
HiHelloHR
 
ChiSquare Procedure in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
유니티에서 Burst Compiler+ThreadedJobs+SIMD 적용사례
Seongdae Kim
 
Home Care Tools: Benefits, features and more
Third Rock Techkno
 
Open Chain Q2 Steering Committee Meeting - 2025-06-25
Shane Coughlan
 
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
Download Canva Pro 2025 PC Crack Full Latest Version
bashirkhan333g
 

2Bytesprog2 course_2014_c8_units

  • 1. Prog_2 course- 2014 2 bytes team Kinan keshkeh IT Engineering-Damascus University 3rd year
  • 4. Introduction How is the compilation process ?? the principle of compilation is based on fragmentation the program into several files then the compiler compile each file separately then Connect all parts of the compiled to configure executable file (conversion program form machine language to “code” language )
  • 5. Unit stop here compilation source file in Pascal language Text files for some procedure or function Unit programing ready to use Libraries ready to use linked Execution
  • 6. unit Unit unitname Interface Implementation Definition : Uses Const Type Var The header of procedure or function Uses Const Type Var The object of procedure or function founded in interface part End. After last end we have to put (.) not (;) Unit divided into two sections : 1) Interface : 2) Implementation :
  • 7. Interface : or what we call it <<public part>> , in this part we can define the visible things to any program or another unit for example : Uses wincrt; Const pi=3.14; Type arr=array[1..100] of integer; var x:integer; Function sum(x,y:integer):integer; Function max(a,b:integer):integer; Note: include interface part we only define the header of procedure or function
  • 8. Implementation : or what we call it <<private part>> in this part we can define invisible things, we can‟t deal with them when we go out from the definition of the unit Uses wincrt; Const max=100; Type person=record fname,lname:string; end; var c:char ; Function sum(x,y:integer): integer; Begin Sum:=x+y; end; Function max(a,b:integer):integer; Begin if (a > b) then Max:=a; Else Max:=b; end;
  • 9. After writing unit what do we have to do ? 1.Correct the errors, if any 2.Compilation 3.Save this file under unit‟s name with (TPU) <<unitname.TPU>> For example : Unit my_unit; Save as:<<my_unit.TPU>> 4.Recall this unit in main program using reserved word (uses) uses my_unit ; Note : unit is subprogram unexecutable we cannot run it ……
  • 10. Unit my_unit1; Interface Const val=200; Var w : integer ; procedure swap(var x,y:integer); Implementation var temp :integer ; procedure swap(var x,y:integer); begin temp:=x; x:=y; y:=temp; end; End. Compilation Attention !!!
  • 11. Unit my_unit1; Interface Const val=200; Var w : integer ; procedure swap(var x,y:integer); Implementation var temp :integer ; readln(x); procedure swap(var x,y:integer); begin temp:=x; x:=y; y:=temp; end; End. {false} There is no Instructions in unit
  • 12. Program prog1; Uses my_unit1; Var a,b :integer; Begin w:=5; temp:=10; a:=2; b:=3; End. {true} {false} a= 3 b= 2 swap(a,b); Writeln(„a= „,a); Writeln(„b= „,b); w,b); w= „,w); w= 5
  • 13. Program prog1; Uses my_unit1; Var a,b,w :integer; Begin w:=5; temp:=10; a:=2; b:=3; End. swap(w,b); Writeln(„w= „,w); Writeln(„b= „,b); My_unit1.w If you want to deal with w in my_unit You should write Which w ???? {this} my_unit1.w:=10
  • 14. Lets make it real :D !!
  • 15. Exercise : أنشئ وحذة بشهج تٍ وعشف ف هٍا تابع قٌىم بحساب ) a^n ( وإجشائ تٍ تقىم بحساب هعكىس عذد طب عٍ وإجشائ تٍ تقىم بطباعت عناصش سلسلت أحاد تٌ بشكل هعكىس )هن النها تٌ حتى البذا تٌ ( ) على أن تتن كتابت الإجشائ اٍث السابقت بشكل عىدي ( ثن استخذم هزه الىحذة ف بشناهج سئ سٍ ورلك لاستذعاء التىابع السابقت
  • 16. Recursion It‟s process that procedure or function recall itself within the body of that procedure or function  Recursion always need to stop condition
  • 17. Unit recursion_unit; Interface type list=^node; node=record value:integer; next : list; end; Function y(a,n:integer): longint ; Procedure reverse(z:integer ; var z1:integer); Procedure printlist (p: list ); Implementation Function y(a,n:integer): longint ; Begin If n=0 then y:=1 else y:=y(a,n-1)*a; end;
  • 18. Procedure reverse(z:integer ;var z1:integer); Begin If (z<>0) then begin Z1:=z1*10 + z mod 10; Reverse (z div 10 , z1); end; end; Procedure printlist(p : list ); Begin If (p^.next <> nil ) then Printlist(p^.next); Write(p^.value:5); end; End.
  • 19. Program pro2bytes_team; uses recursion_unit; var a,n,z,z1,m,x,i:integer; p,temp:list; Begin Readln(a,n); If (n < 0) then Writeln(„a^n = „,1/y(a,n)) Else Writeln(„a^n = „,y(a,n)); Writeln(„ input positive number „); Readln(z); z1:=0; Reverse (z,z1); Writeln(„z1 = „,z1);
  • 20. Writeln(„input the number of nodes „); Readln(m); Writeln(„input the value „); Readln(x); new(p); p^.value:=x; temp:=p; for i:=2 to m do begin new(temp^.next) ; temp:=temp^.next; Writeln(„input the value „); Readln(x); temp^.value:=x; end; temp^.next:=nil; Printlist(p); End.
  • 21. Execution : Function y(a,n:integer): longint ; Begin If n=0 then y:=1 else y:=y(a,n-1)*a; end; n=3 a=2 a = n y= * 2 n= 3 n= 2 n= 1 n= 0 y= * 2 y= * 2 y = 1 waiting waiting waiting stop condition 8 4 2 1 End.
  • 22. Procedure printlist(p : list ); Begin If (p^.next <> nil ) then Printlist(p^.next); Write(p^.value:5); end; End. Execution : next 20 15 10 5 p nil p p p stop condition !!! output 20 15 10 5
  • 23. Group : group link Mobile phone- Kinan : 0994385748 Facebook account : kinan’s account 2 bytes team