Function - Study Mode

[#126] What will be the output of the following C code? #include <stdio.h>
void main()
{
static int x = 3

x++

if (x <= 5)
{
printf("hi")

main()

}
}
Correct Answer

(D) hi hi

[#127] What will be the output of the following C code? #include <stdio.h>
void main()
{
int x = 3

{
x = 4

printf("%d", x)

}
}
Correct Answer

(A) 4

[#128] Which of following is not accepted in C?
Correct Answer

(C) static static int a //a static variable prefixed with static

[#129] What will be the output of the following C code? #include <stdio.h>
int *m()

void main()
{
int k = m()

printf("%d", k)

}
int *m()
{
int a[2] = {5, 8}

return a

}
Correct Answer

(D) Varies

[#130] What will be the output of the following C code having void return-type function? #include <stdio.h>
void foo()
{
return 1

}
void main()
{
int x = 0

x = foo()

printf("%d", x)

}
Correct Answer

(D) Compile time error