Function - Study Mode
[#111] What will be the output of the following C code? #include <stdio.h>
void main()
{
m()
printf("%d", x)
}
int x
void m()
{
x = 4
}
Correct Answer
(B) Compile time error
[#112] What will be the output of the following C code? #include <stdio.h>
int main()
{
register static int i = 10
i = 11
printf("%d
", i)
}
Correct Answer
(B) Compile time error
[#113] What will be the output of the following C code? #include <stdio.h>
#include "printf"
void main()
{
printf("hello")
}
Correct Answer
(B) Error
[#114] Can variable i be accessed by functions in another source file? #include <stdio.h>
int i
int main()
{
printf("%d
", i)
}
Correct Answer
(A) Yes
[#115] Comment on the following 2 C programs. #include <stdio.h> //Program 1
int main()
{
int a
int b
int c
}
#include <stdio.h> //Program 2
int main()
{
int a
{
int b
}
{
int c
}
}
Correct Answer
(C) In Program 1, variables a, b and c can be used anywhere in the main function whereas in Program 2, variables b and c can be used only inside their respective blocks