Scope of variables Flashcards

1
Q

Local variables are also known as?
{note:there are three scope type of variables
1. local variable
2. Global variable.
3.Formal parameters.

A

Internal,private or automatic variable.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Scope of local variable

A

Inside a function or a block.
local variables ka scope curly braces ke andar ka hi hota hai

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Scope of global variable

A

Can be accessed from all over the code.
Global variables store value for lifetime.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Scope of formal parameters

A

Formal parameters, are treated as local variables with-in a function and they
take precedence over global variables.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Initial default value of data type int

A

0

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

initial default value of data type char

A

‘\0’

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

initial default value of data type float

A

0

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

initial default value of data type double

A

0

How well did you know this?
1
Not at all
2
3
4
5
Perfectly