adplus-dvertising
frame-decoration

Question

What is the output of this C code?
#include <stdio.h>
    double foo();
    int main()
    {
        foo();
        return 0;
    }
    foo()
    {
        printf("2 ");
        return 2;
    }

a.

2

b.

Compile time error

c.

Depends on the compiler

d.

Depends on the standard

Posted under C Programming

Answer: (b).Compile time error

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is the output of this C code? #include <stdio.h> double foo(); int main() { foo(); return 0; } foo() {...