C-Storage Class Question and Answer
C-Storage Class Question and Answer
41. Find the output
void man ( )
{
har *p;
char (show( );
p=show ( );
printf('%c", *p;
}
char *show()
{
char *m;
m=(char *p) malloc(1);
*m='b';
++*m;
return m;
}
void man ( )
{
har *p;
char (show( );
p=show ( );
printf('%c", *p;
}
char *show()
{
char *m;
m=(char *p) malloc(1);
*m='b';
++*m;
return m;
}
- B
- C
- Garbage
- Compilation error
42. Find the output
void main ( )
{
char *p='CITE";
char *q;
q=(char *) malloc (strlen(p));
while (*q++);
printf("%s", q);
}
void main ( )
{
char *p='CITE";
char *q;
q=(char *) malloc (strlen(p));
while (*q++);
printf("%s", q);
}
- CITE
- ITE
- NULL
- None of these
43. To access a semi-global variable
- Auto is used
- Register is used
- Extern is used
- Static is used
44. Find the output.
int i=4;
void main ( )
{
int i=1;
{
sttic int i=5;
}
printf('5d', i);
}
int i=4;
void main ( )
{
int i=1;
{
sttic int i=5;
}
printf('5d', i);
}
- 4
- 1
- 5
- 0
45. Which storage class allocates and deallocates memory without the knowledge of user?
- Auto
- Register
- Static
- Extern
46. Which storage class share memory into different frames of the function recursion ?
- Auto
- Static
- Register
- Extern
47. External variable can not be initialized, because
- It is a variable declaration
- It is a run time variable
- It is variable definition
- None of these
49. Find the output
void main ( )
{
int const * size=10;
printf('5d", ++size);
}
void main ( )
{
int const * size=10;
printf('5d", ++size);
}
- 10
- 11
- 12
- Compilation error
50. What are the allowed storage class in function prototype declaration ?
- Static
- Extern
- Register
- Both a and b