C-Storage Class Question and Answer
C-Storage Class Question and Answer
1. The area or scope of the variable depends on its
- Data type
- Storage class
- System type
- None of these
2. The storage class of a variable tells the compiler
- The storage area of the variable
- the default initial value of a variable
- Life of the variable
- All the above
3. Which variables can not be directly accessed by other functions ?
- Auto
- Static
- Register
- Extern
4. if float and double are defined wity type register the compiler treats them as
- Auto variables
- Static variables
- Register variables
- Extern variables
8. Find the output.
void main ( )
{
int static auto x;
x=5;
printf("5d", ++x);
x--;
printf ("%d", x);
}
void main ( )
{
int static auto x;
x=5;
printf("5d", ++x);
x--;
printf ("%d", x);
}
- Error: too many storage classes in declaration
- 6 5
- 6 6
- None of these
9. Which storage class variables are created in stack?
- Auto
- Auto, static
- Register, static
- Extern, static
10. Whch of the following are created during execution time?
- Auto & static variables
- Register and static variables
- All variables are created during compile time
- Auto and register variables