Function - Study Mode

[#146] 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

}
Correct Answer

(B) Data segment

[#147] What will be the output of the following C code? #include <stdio.h>
int x

void main()
{
printf("%d", x)

}
Correct Answer

(C) 0

[#148] What will be the output of the following C code? #include <stdio.h>
#define MIN 0
#if defined(MIN) + defined(MAX)
#define MAX 10
#endif
int main()
{
printf("%d %d
", MAX, MIN)

return 0

}
Correct Answer

(A) 10 0

[#149] What will be the output of the following C code? #include <stdio.h>
int foo(int, int)

#define foo(x, y) x / y + x
int main()
{
int i = -6, j = 3

printf("%d ",foo(i + j, 3))

#undef foo
printf("%d
",foo(i + j, 3))

}
int foo(int x, int y)
{
return x / y + x

}
Correct Answer

(A) -8 -4

[#150] What will be the output of the following C code? #include <stdio.h>
int x

void main()
{
m()

printf("%d", x)

}
void m()
{
x = 4

}
Correct Answer

(B) 4