CSE MCQs :: C-MCQs
-
What is the output of this C code?
int main()
{
int a = 1, b = 1, d = 1;
printf("%d, %d, %d", ++a + ++a+a++, a++ + ++b, ++d + d++ + a++);
} - For which of the following, "PI++; code will fail?
-
What is the output of this C code?
int main()
{
int a = 10, b = 10;
if (a = 5)
b--;
printf("%d, %d", a, b--);
} -
What is the output of this C code?
int main()
{
int i = 2;
int j = ++i + i;
printf("%d\n", j);
} -
Comment on the output of this C code?
int main()
{
int i = 2;
int i = i++ + i;
printf("%d\n", i);
} -
What is the output of this C code?
int main()
{
int i = 0;
int x = i++, y = ++i;
printf("%d % d\n", x, y);
return 0;
} -
What is the output of this C code?
int main()
{
int i = 10;
int *p = &i;
printf("%d\n", *p++);
} -
What is the output of this C code?
void main()
{
int x = 97;
int y = sizeof(x++);
printf("X is %d", x);
} -
What is the output of this C code?
void main()
{
int x = 4, y, z;
y = --x;
z = x--;
printf("%d%d%d", x, y, z);
} -
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);
}