Scope of variables Flashcards
Local variables are also known as?
{note:there are three scope type of variables
1. local variable
2. Global variable.
3.Formal parameters.
Internal,private or automatic variable.
Scope of local variable
Inside a function or a block.
local variables ka scope curly braces ke andar ka hi hota hai
Scope of global variable
Can be accessed from all over the code.
Global variables store value for lifetime.
Scope of formal parameters
Formal parameters, are treated as local variables with-in a function and they
take precedence over global variables.
Initial default value of data type int
0
initial default value of data type char
‘\0’
initial default value of data type float
0
initial default value of data type double
0