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 y = 1;
if (y & (y = 2))
printf(“true %d\n”, y);
else
printf(“false %d\n”, y);
}

What will be the output of the following C code?
#include <stdio.h>
int main()
{
int y = 1;
if (y & (y = 2))
printf(“true %d\n”, y);
else
printf(“false %d\n”, y);
}
a) true 2
b) false 2
c) either true 2 or false 2
d) true 1

Answer: a

Join The Discussion