; begin ; end; Masalan: a) procedure sutta (A,B,C: integer; var s: real); b) procedure FAK (n: integer; var F: real); Proseduralarni bajarish uchun dasturning kerakli joyida murojaat qilish kerak bo‘ladi. Proseduraga murojaat qilinganda formal parametrlarfaktik parametrlar bilan almashadi. Bu quyidagicha bo‘ladi:
(): Masalan: a) Summa (5, m, 7, S1); b) FAK (20, F1); Agar prosedura parametrsiz bo‘lsa, u holda ularga murojaat bo‘lganda faqat prosedura nomi ko‘rsatiladi. Masalan: a) Summa; b) FAK ; c) Step; Misol. n natural ko’rsatkichli y=x darajani hisoblash dasturini procedura ko’rinishida ifodalang.
Prasedure daraja(n:integer;x:real;var y:real); var i : integer; begin y := 1; for i := 1 to N do y := y*x; end.
Misol. Prosedura (procedure) dan foydalanib hisoblash dasturini tuzing.
Masalani yechish dasturi (Paskal tilida) program ifoda;
var S, S1, S2, S3, S4, S5: real; m, n: integer;
procedure FAK (L: integer; var p: real);
var I:integer;
begin p:=1; for i:=1 to L do p:=p*I; end;
begin readln (n,m);
FAK (n+m,S1); FAK (n*n+2*n-1,S2);
FAK (m+n-1, S3); FAK (2+n, S4); FAK (2*m-1,S5);
S:= (S1+S2) / (S3+S4+S5); writeln (‘S=’,S);
end.
Mavzu: Qism dasturdan foydalanib dastur tuzish. Reja: Function ga doir dastur tuzish.
Mustaqil topshiriqlar bajarish.
Mashg’ulotning maqsadi: Functionga doir dastur tuzishni o’rganish.
Functionga doir dastur tuzishni o’rganish ko’nikmalarini shakllantirish.
Dars o’tish usuli:Takrorlash, suhbat va savol-javob, mavzu mazmunidan kelib chiqib talabalarga mustaqil topshiriqlar berish va ularni tasavvurini bilish.