answersLogoWhite

0

A variable that is used in all program modules is?

Updated: 8/17/2019
User Avatar

Wiki User

12y ago

Best Answer

global

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: A variable that is used in all program modules is?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What was the job of the Lunar Modules and where are they now?

Lunar modules were mainly used to land on the moon and then to return tto the main spacecraft. The lunar modules are all on the moon.


Write the difference between global variable and static variable in context to function with suitable example?

Static VariableA variable that exists in only one location and is globally accessible by all instances of a class and also a variable for which memory remains allocated as long as the program executes.Global VariableA variable that can be accessed by all parts of a program so it does not belong to any subroutine in particular and can therefore can be accessed from any context in a program


Difference Between Variable And constant?

A constant and variable are variations of data types. int a; is a variable and its value can be changed by the program as the program runs. const int b; is a constant with a fixed value and will have its value set and may not be changed by the program as as the program runs. All data types may be declared as a constant. Variable Value Can Be Changed By You In Programme.


A class in a program whose objects are created and destroyed throughout the program It is desired that the total number of live objects in the program be known how you do this in C plus plus?

Create a static member variable to contain the count. This variable is common to all instances of the class.Initialize that variable to zero at the beginning of the program.In the class constructor, increment the variable.In the class destructor, decrement the variable.


What does modular program and non-modualr program mean?

Modular programming is the technique which divides the entire program into smaller modules, which perform a specific task. Even though the simple program structure works well for simple examples, it is counter-productive for longer programs, leading to lack of clarity and slowing code maintenance and modification. The programmer designs the program in levels, where a level consists of one or more modules. The first level is a complete main program and modules at successive levels consist of sub modules referenced in the prior levels. A module is a set of program statements which, when acting together complete a specific task. In practice a module can be a function and the main program can consist of a sequence of calls to the functions that represent the modules of the next levels down. The order in which the modules are executed by the computer is controlled by the main program. This describes fully the procedures required in the solution to a problem. The procedures are written in the order of the machine execution. Modules should be structured within themselves by incorporating the constructs of sequencing, selection and repetition. Every program can and should be written using only these constructs.


When a module is executing what happens when the end of the module is reached?

When a module is called, the computer jumps to that module and executes the statement in the module's body. Then, when the end of the module is reached, the computer jumps back to the part of the program that called the module, and the program resumes execution at that point.End


What was the name of the American spaceships used in the trips to the moon?

The program was called Apollo, and the missions designated with a number. Apollo 11 was the first to land on the moon. The command and lunar modules were all given different names by their crews.


How are coupling and cohesion related to modular design?

Ideally, modules will have low coupling and high cohesion. Coupling describes the strength of the connection between modules in a program. Loose (or low) coupling occurs when modules do not depend on other modules. One way to control this is by avoiding the use of global variables and reducing the number of variables that are passed between the modules. Another is to limit the depth of module calls (where a module calls another module, that then calls another module, and so on). Cohesion is a measure of how well a module accomplishes the module's purpose. High cohesion implies that all the module's internal statements serve to perform the module's (single) task. In order for modules to work together, there must be some connection between them. The nature of the connection is important because it determines the extent to which the modules are coupled. How are they connected? The best way to connect them is to pass the value of a local variable in one module to a second module through its parameter list. (A local variable is a variable that is defined within a module (not a parameter) is local to that module. The values of local variables are not available outside of the module in which they are declared unless they are passed. Local variables are reset to their default values once control leaves the module in which they are declared.) Another way to share information is through the use of global variables. (A variable that is defined outside of a module and that does not need to be passed to a module to be accessed by it is a global variable. Global variables retain their value once control leaves the module in which they are referenced. ) Because the value of a global variable can be changed by any module without passing, it increases the coupling between modules.


What are the necessary condition for a deadlock?

1) An environment that allows more than one program to access the same set of variable. 2) The ability of a program to "sleep" until it can have (access) a varible. 3) The ability of a program to block other programs from having (accessing) a variable. Dead Lock example: Program GoodGosh and GoshDarn both access variables A and B by "Locking" the variables, doing some processing, and then releasing the variables. Both variables have to be obtained and locked before further processing and unlocking can occur. While processing, Program GoodGosh acquries a lock on variable A and then attempts to acqure a lock on Varable B. Before GoodGosh can acquire variable B, Program GoshDarn acqures a lock on variable B. GoodGosh want B and owns A. GoshDarn owns A and wants B. Neither can process further until the other releases a variable. Deadlock now exists. Note: To prevent deadlocks, all modules/programs that access the same set of variables should always acquire the variables in the same order.


Why all variables are declared with in the function?

It is not necessary to to declare variables inside the function in C. If you declare a variable inside a function, the variable becomes local for the function and another variable of same name can be declared in any other function, but you can not use the variable declared in other function. When you declare any variable outside the function body then the variable becomes global and can be used in any function of the program. Note: errno is an example for a variable declared outside any function.


How do you create a global variable in a program?

1.In computer programming, a global variable is a variable that is accessiblein every scope.2.There are some variables that are used in more than one function.suchvariables are called global variables.3.Usually,they are declared in global declaration section that is outsideof all functions.4.In this section,we can also declare all user-defined functions.DECLARATION:int global =5;


What is advantages and disadvantages of HIPO chart?

Advantage : In HIPO chart all input and output for each modules are clearly identified and also determine very easily that what modules call the modules being examined. Disadvantage : The main disadvantage of HIPO is that the documentations for a program gets to be rather bulky: there is a page for each module regardless of the actual size of the module.