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()
{
int *p = NULL;
for (foo(); p; p = 0)
printf(“In for loop\n”);
printf(“After loop\n”);
}

What will be the output of the following C code?
#include < stdio.h >
int main()
{
int *p = NULL;
for (foo(); p; p = 0)
printf(“In for loop\n”);
printf(“After loop\n”);
}
a) In for loop after loop
b) Compile time error
c) Infinite loop
d) Depends on the value of NULL

Answer: b

Join The Discussion