Variables
- What is the scope of a function?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
From the point of declaration to the end of the file being compiled
- What is the scope of an external variable?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
From the point of declaration to the end of the file being compiled
- What will be the output of the following C code (after linking to source file having definition of arrayA)?
#include <stdio.h>
int main()
{
extern arrayA[];
printf("%d\n", arrayA[0]);
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
Compile time error because datatype of array is not provided
- What will be the output of the following C code (without linking the source file in which arrayA is defined)?
#include <stdio.h>
int main()
{
extern arrayA[];
printf("Interview Mania\n");
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
Interview Mania
- What will be the output of the following C code?
#include <stdio.h>
int n;
int main()
{
extern int n;
if (p == 0)
printf("Scope rules follow here\n");
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
Scope rules followed