Variables
- What will be the output of the following C code?
#include <stdio.h>
int *ptr;
int main()
{
if (ptr == NULL)
printf("Right\n");
return 0;
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
Right
- What will be the output of the following C code?
#include <stdio.h>
int *p;
int main()
{
if (p == 0)
printf("Hey\n");
return 0;
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
Hey only if NULL value is 0
- Which of the following statement is false?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
It is not an error if the variable is declared and not defined. For example – extern declarations.
- 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
- 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