1 - | Azad Sir
1. [pic]
[pic]
2. [pic]
3. What is the difference between Local Variable and Global Variable?
Also, give a suitable C++ code to illustrate both.
Ans Local Variables: Local variables are those variables which are declared
within a function or a compound statement and these variables can only be
used within that function/scope.
Global Variables: Global variables are those variables which are not declared
within any function or scope. So, these variables can be accessed by any
function of the program.
Example
#include
#include
int G; // Global variable declared
341
void Fun ( )
{
int L = 25; // Local variable of function Fun ( ) assigned value 25
G=5; // Global Variable is accessed and assigned value 5
Cout ................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related searches
- sir isaac newton gravity
- sir speech intelligibility rating scale
- sir run run shaw
- sir run run shaw hospital
- speech intelligibility rating scale sir pdf
- service sir essay writing writer essay
- sir isaac newton 3 laws of motion
- sir names and nationalities
- what does sir stand for
- sir or sir
- what is sir short for
- 1 or 2 374 374 1 0 0 0 1 168 1 1 default username and password