CSE MCQs :: C-MCQs
-
What is the output of this C code?
void main()
{
int x = 4;
int *p = &x;
int *k = p++;
int r = p - k;
printf("%d", r);
} -
What is the output of this C code?
void main()
{
int a = 5, b = -7, c = 0, d;
d = ++a && ++b || ++c;
printf("\n%d%d%d%d", a, b, c, d);
} -
What is the output of this C code?
void main()
{
int a = -5;
int k = (a++, ++a);
printf("%d\n", k);
} -
What is the output of this C code?
int main()
{
int x = 2;
x = x << 1;
printf("%d\n", x);
} -
What is the output of this C code?
int main()
{
int x = -2;
x = x >> 1;
printf("%d\n", x);
} -
What is the output of this C code?
int main()
{
if (~0 == 1)
printf("yes\n");
else
printf("no\n");
} -
What is the output of this C code?
int main()
{
int x = -2;
if (!0 == 1)
printf("yes\n");
else
printf("no\n");
} -
What is the output of this C code?
int main()
{
int y = 1;
if (y & (y = 2))
printf("true %d\n");
else
printf("false %d\n");
} -
What is the difference between the following 2 codes?
//Program 1
int main()
{
int d, a = 1, b = 2;
d = a++ + ++b;
printf("%d %d %d", d, a, b);
}
//Program 2
int main()
{
int d, a = 1, b = 2;
d = a++ + ++b;
printf("%d %d %d", d, a, b);
} -
What is the output of this C code?
int main()
{
int a = 1, b = 1, c;
c = a++ + b;
printf("%d, %d", a, b);
}