Writeln('value of x = ', x, ' y = ', y, ' and z = ', z) ĭisplaying the global variables a, b, and cĭisplaying the local variables x, y, and z Writeln('Displaying the local variables x, y, and z') Writeln(' Displaying the global variables a, b, and c') Following is an example using global and local variables − That is, a global variable is available for use throughout your entire program after its declaration. The global variables will hold their value throughout the lifetime of your program and they can be accessed inside any of the functions defined for the program.Ī global variable can be accessed by any function. Global variables are defined outside of a function, usually on top of the program. When the above code is compiled and executed, it produces the following result − Writeln('value of a = ', a, ' b = ', b, ' and c = ', c) Writeln('Winthin the procedure display')
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |