Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

What will be the output of the following C code?
#include < stdio.h >
int main()
{
void foo(), f();
f();
}
void foo()
{
printf(“2 “);
}
void f()
{
printf(“1 “);
foo();
}

What will be the output of the following C code?
#include < stdio.h >
int main()
{
void foo(), f();
f();
}
void foo()
{
printf(“2 “);
}
void f()
{
printf(“1 “);
foo();
}
a) Compile time error as foo is local to main
b) 1 2
c) 2 1
d) Compile time error due to declaration of functions inside main

Answer: b

Join The Discussion