Variables
- What will be the output of the following C code?
#include <stdio.h>
static int var = 15;
void main()
{
var = 19;
{
int var = 14;
}
printf("%d", var);
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
19
- 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
- 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
- Property of the external variable to be accessed by any source file is called by the C90 standard as __________.
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
external linkage
- Can variable p be accessed by functions in another source file?
#include <stdio.h>
int p;
int main()
{
printf("%d\n", p);
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
Yes