Storage Classes MCQ Questions and Answers

Home | C Language | Storage Classes

Storage Classes MCQs Questions - Student! here available c language mcq on storage classes, you can learn and test online questions with answers.

Page: 2/4

11) What will be the output of the following C code?

 #include <stdio.h>
double i;
int main()
{
printf("%g\n",i);
return 0;
}

12) Which part of the program address space is p stored in the following C code?

 #include <stdio.h>
int *p = NULL;
int main()
{
int i = 0;
p = &i;
return 0;
}

13) Which part of the program address space is p stored in the following C code?

 #include <stdio.h>
int *p;
int main()
{
int i = 0;
p = &i;
return 0;
}

14) Can variable i be accessed by functions in another source file?

 #include <stdio.h>
int i;
int main()
{
printf("%d\n", i);
}

15) Property of the external variable to be accessed by any source file is called by the C90 standard as __________

16) What will be the output of the following C code?

 #include <stdio.h>
int *i;
int main()
{
if (i == NULL)
printf("true\n");
return 0;
}

17) What will be the output of the following C code?

 #include <stdio.h>
int *i;
int main()
{
if (i == 0)
printf("true\n");
return 0;
}

18) What will be the output of the following C code?

 #include <stdio.h>
int i;
int main()
{
extern int i;
if (i == 0)
printf("scope rules\n");
}

19) What will be the output of the following C code (without linking the source file in which ary1 is defined)?

 #include <stdio.h>
int main()
{
extern ary1[];
printf("scope rules\n");
}

20) What will be the output of the following C code (after linking to source file having definition of ary1)?

 #include <stdio.h>
int main()
{
extern ary1[];
printf("%d\n", ary1[0]);
}