What will be output of following C code having void return-type function?

What will be the output of the following C code having void return-type function?

What will be the output of the following C code having void return-type function? mcq and its answer is provided on this page.

What will be the output of the following C code having void return-type function?

Que. What will be the output of the following C code having void return-type function?
a. #include <stdio.h> void foo() { return 1; } void main() { int x = 0; x = foo(); printf("%d", x); }
b. a) 1
c. b) 0
d. c) Runtime error
e. d) Compile time error
Answer: d
Explanation : None.


Comments