![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
|||||||||||||||||||||||
|
Image sizes: 256x256, 64x64, 48x48, 40x40, 32x32, 24x24, 20x20, 16x16 File formats: BMP, GIF, PNG, ICO ![]() ![]() ![]() ![]() Tags: emo online icons, filder icons, to make a heart icon, msword icon, boomber iconProgram Fn; Var A, B, C:Real;Function Max (A, B:Real):Real; we Describe function Max with formal Begin in parametres A and B which accepts |If A> B Then Max: = A value maximum from them Else Max: = B Here A and B - local variables |End; Begin |Writeln (' Enter three numbers '); Readln (A, B, C); Writeln (' Maximum from all is ', Max (Max (A, B), C)) End. Pay attention to short of a body of the main program and on a transparency Operations in function. Formal parametres A and B, used in the subroutine, have no ratio to variables A and B, described in To the main program. There are two ways of transmission of actual parametres in the subroutine: on value and by reference. In the first case the value - actual parametre at subroutine call is assigned by a local variable, The subroutine being formal parametre. What then occurred to a local variable, it will not be mirrored in any way in the appropriate global. For one tasks this blessing, but sometimes it is required to make in the operation subroutine over the variables specified in quality Actual parametres. The second way to the aid comes. There is a following: at call to the subroutine there is no local variable creation - formal parametre. It will be simple on execution time of the subroutine name of this local variable to specify in the same area of memory, as a name of an appropriate global variable. If in this case to change a local variable, the data and in the global will vary. ![]()
| Copyright © 2006-2022 Aha-Soft. All rights reserved. |
|