Wednesday, 1 May 2019

ch- Storage Class

storage classes

Register variable are active 
A) Outside the function 
B) Throughout the program 
C) Only in the function where it is defined
 D) Surrounding of that function


What is the output of this code
 #include 
void main() 

static int x; if(x++<2)
 main();
 } 
A) Infinite calls to main
 B) Run time error 
C) Varies 
D) Main is called twice

Which of the following is not a proper storage class in ‘C’?
A) auto 
B) dcc 
C) static 
D) extern 

1.10 Is the following statement declaration or definition: extern int i; 
a) Declaration 
b) Definition
c) Function 
d) Error


ans a) Declaration 

3 By default, storage class of local variable is ___auto_____
 Variables that are alive and active throughout the program are called _____global____ variables.

___extern_____ int fun(); - the declaration indicates the presence of a global function defined outside the current module or in another file. 

Global variable is initialized to __zero______ by default

What do you understand by local, global and static variables ? Explain
(c) Compare the lifetime, Scope, Initial value and storage place of all storage classes.

Explain different storage classes available in „C‟


No comments:

Post a Comment

Index

ch-1 Introduction