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 >
#define foo(x, y) x / y + x
int main()
{
int i = -6, j = 3;
printf(“%d “, foo(i + j, 3));
printf(“%d\n”, foo(-3, 3));
return 0;
}

What will be the output of the following C code?
#include < stdio.h >
#define foo(x, y) x / y + x
int main()
{
int i = -6, j = 3;
printf(“%d “, foo(i + j, 3));
printf(“%d\n”, foo(-3, 3));
return 0;
}
a) -8 -4
b) -4 divided by zero exception
c) -4 -4
d) Divided by zero exception

Answer: a

Join The Discussion