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 having void return-type function?
#include < stdio.h >
void foo()
{
return 1;
}
void main()
{
int x = 0;
x = foo();
printf(“%d”, x);
}

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

Answer: d

Join The Discussion