C-Storage Class Question and Answer
C-Storage Class Question and Answer
31. Find the output
main ( )
{
show ( );
show ( );
}
int show ( )
{
static int a=5;
a++;
printf("5d", a);
}
main ( )
{
show ( );
show ( );
}
int show ( )
{
static int a=5;
a++;
printf("5d", a);
}
- 5 5
- 6 6
- 5 6
- 6 7
32. Which of the following storage class creates a block scoping ?
- Auto
- Register
- Static
- Extern
33. Find the output.
void main ( )
{
int x;
#include<stdio.h>
x=printf("clrscr ( )");
printf('5d", x);
}
void main ( )
{
int x;
#include<stdio.h>
x=printf("clrscr ( )");
printf('5d", x);
}
- c1rscr()8
- c1rscr()
- Run time error
- Compile time error
34. Writing static to a global variable means
- The variable is only visible to that file
- The variable is only visible to other file
- The variable is only visible to all file
- None of these
36. The storage class which has no storage, life, initial value, scope and linkage is
- Auto
- Register
- Extern
- Typedef
37. The storage class which creates new name of the data type
- Auto
- Register
- Extern
- Typedef
38. Find the output
main ( )
{
show ( );
show ( );
}
int show ( )
{
extern int a;
a++;
printf('%d", a);
}
int a=5;
}
main ( )
{
show ( );
show ( );
}
int show ( )
{
extern int a;
a++;
printf('%d", a);
}
int a=5;
}
- 5 5
- 6 6
- 5 6
- 6 7
39. Find the output
int a=20;
void main ()
{
int a=5;
{
int a=10;
}
printf("5d", a);
}
int a=20;
void main ()
{
int a=5;
{
int a=10;
}
printf("5d", a);
}
- 20
- 5
- 10
- None of these
40. Which of the storage class allocates memory in run time ?
- Auto
- Register
- Static
- Extern