Function - Study Mode
[#151] What will be the output of the following C code? #include <stdio.h>
int foo()
int main()
{
int i = foo()
}
foo()
{
printf("2 ")
return 2
}
Correct Answer
(A) 2
[#152] What will be the output of the following C code? #include <stdio.h>
#define foo(m, n) " m ## n "
int main()
{
printf("%s
", foo(k, l))
}
Correct Answer
(D) m ## n
[#153] What will be the output of the following C code? #include <stdio.h>
int main()
{
int one = 1, two = 2
#ifdef next
one = 2
two = 1
#endif
printf("%d, %d", one, two)
}
Correct Answer
(B) 1, 2
[#154] What will be the output of the following C code? #include <stdio.h>
void m()
{
printf("hi")
}
void main()
{
m()
}
Correct Answer
(A) hi
[#155] What will be the output of the following C code? #include <stdio.h>
void func()
int main()
{
static int b = 20
func()
}
void func()
{
static int b
printf("%d", b)
}
Correct Answer
(A) Output will be 0