C-Storage Class Question and Answer

C-Storage Class Question and Answer
21. Find the output
void main ( )
{
int i=3;
while (i<5)
{
static int j=2;
printf ('5d", j++);
i++;
}
}

  • 2 2
  • 3 2
  • 2 3
  • 3 3
Show Answer
22. Find the incorrect one for 'typedef' storage class
  • Permits descriptive names for datatypes.
  • Renaming existing datatype
  • Modification of the program is easier when host machine is changed.
  • All of the above
Show Answer
23. In which of the storage class, initialization is done only once ?
  • Static
  • Auto
  • Extern
  • Typedef
Show Answer
24. Which of the following is used to call a C module in C++.
  • extern "C"
  • extern "C++"
  • iostream.h
  • None of these
Show Answer
25. Find the output
void main ( )
{
int i;
static int j=0;
for (i=1; i<5;i++)
call (j);
}
call (int j)
{
j++;
printf (%d", j);
}

  • 1 2 3 4
  • 1 1 1 1
  • 0 1 2 3
  • None of these
Show Answer
26. Which storage class variable is best suited for loop counter ?
  • Auto
  • Static
  • Register
  • Typedef
Show Answer
27. A variable having bloc scope is known as
  • Local variable
  • private variable
  • Public variable
  • Internal variable
Show Answer
28. Which of the following storage class creates a file scoping ?
  • Auto
  • Register
  • Static
  • Extern
Show Answer
29. If the CPU fails to keep the variable in CPU register, in that case the variables are assumed to be
  • Automatic
  • Static
  • External
  • None of these
Show Answer
30. Which of the following storage class creates a program scoping ?
  • Auto
  • Register
  • Static
  • Extern
Show Answer
Questions and Answers for Competitive Exams Various Entrance Test