adplus-dvertising
frame-decoration

Question

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

a.

2

b.

Compile time error

c.

Depends on the compiler

d.

Depends on the standard

Posted under Functions C Programming

Answer: (a).2

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> int foo(); int main() { int i = foo(); } foo() { printf("2 ");...