Best Answer

A local variable is a variable declared inside a construct, such as a class or function, while a global variable is a variable declared outside of any construct.

User Avatar

Wiki User

โˆ™ 2013-07-31 21:02:38
This answer is:
User Avatar
Study guides
See all Study Guides
Create a Study Guide
12 Reviews
More answers
User Avatar

Wiki User

โˆ™ 2013-10-22 08:56:55

ad1: 'global variable n'

ad2: 'local variable m'

Note: don't forget pseudocode means human readable text

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How can you declare global and local variable in pseudocode?
Write your answer...
Still have questions?
magnify glass
Related questions

How can you declare global and local variables in pseudcode?

You declare global and local variables in pseudocode the same way you declare them in real code. You place local variables within blocks, and you place global variables outside of all blocks.

What is variable scope in programming?

variable scobe means which is used to declare the variable in a block local or global position this is a related ans

How do you declare global and local variables in pseudocode?

Pseudocode is not a programming language (it's specifically intended for human interpretation), so there is no need to declare variables, you simply define them as and when you require them. For instance: Let x = 42 Let y = x * 2

Is a global variable a non-local variable?

True, a variable cannot be both global and local. But if a global and a local variable share the same name, the local one will hide the global.

How can you declare global and local variable in flowcharts?

In Raptor: Global variables are to be displayed in the assignment window, while the local ones need to be input into the input box.

How do you declare local and global variables in pseudo code?

You would declare them how you would in a real programming language. Let's say I have a function called foo. function foo() { variable = 1; } Inside that function is a variable called variable. That is a local variable since it is declared only within the function body. As soon as that function returns, the variable ceases to exist. In order to declare a global variable, you would declare it outside of any function, thereby making it accessible to the entire program. variable2 = 2; function foo() { variable = 1; }

What is a local variable?

Local variable is a variable having local scope. Local variable has higher priority than global priority.

What is the difference between a static variable a global variable and a local variable?

A static variable is a variable allocated in static storage. A local variable is a variable declared inside a function. A global variable is a variable declared outside of any class or function. Note that local variables and global variables can both be allocated in static storage.

How you can declare local variable?

variable exit within a function and curly braces is local variable int main() { int x; }

How are global variable different from local variable in Visual BASIC?

A global variable is available for use throughout the program. It is normally declared outside any procedure. A local variable is only available for use in the procedure it was declared in. Most variables are local, but there will be occasions when you want different procedures to be able to use the same variable. This is when you use a global variable.

What is the difference between declaring static variable as local and global?

There are two ways to declare varibles. 1. Locally 2. Globally When you declare a variable locally in any function that means it is only accessible by that function. When you declare a variable globally so it is accessible by all the functions in the program. Declaring variables with static keyword means you are setting its value null.

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.

People also asked