C-Storage Class Question and Answer
C-Storage Class Question and Answer
11. Which variables can't be used as function parameters ?
- Auto
- Register
- Static
- None of the above
12. Find the output.
int x=5;
void main ( )
{
int i=1;
{
extern int x;
printf('%d", x);
}
int x=5;
void main ( )
{
int i=1;
{
extern int x;
printf('%d", x);
}
- Error: multiple declaration is not allowed
- 1
- 5
- Garbage
13. Static storage class can be used as :
- External variable
- Local variable
- Register variable
- Both a and B
14. Static global variable have
- Internal linkage
- External linkage
- No linkage
- None of these
15. What is the output?
int x=1;
void main ( )
{
printf('5d", x--);
}
int x=1;
void main ( )
{
printf('5d", x--);
}
- Garbage value
- 1
- Compilation error
- None of these
16. Find the output.
int x;
void main ( )
{
extern int x=5;
printf (5d", x);
}
int x;
void main ( )
{
extern int x=5;
printf (5d", x);
}
- 5
- No output
- Compilation error
- None of these
17. Why address of registervariable can't be found using '&" operator?
- Register variable are not stored in memory
- Register of the cpu usually not addressable
- Register vaiable is not suitable for long value.
- Register variable are runtime variable.
18. Static variable are useful in
- Sharing the same memory location into different frame of recursion.
- File sciping
- overcome dangling pointer
- All of the above
19. Find the output if the value of x is given as 5
void main ( )
{
register int x;
scanf ('5d", &x;
printf('%d", x);
}
void main ( )
{
register int x;
scanf ('5d", &x;
printf('%d", x);
}
- 5
- 0
- Garbage
- Compilation error
20. In a program if we declare both external and auto variables then the first priority will goes to which variable ?
- External variable
- both have equal priority
- Auto variabe
- None of these