CSE MCQs :: C-MCQs
- Operation "a = a * b + a can also be written as:
-
What is the output of this C code?
int main()
{
int a = 1, b = 2;
a += b -= a;
printf("%d %d", a, b);
} -
What is the output of this C code?
int main()
{
int a = 4, n, i, result = 0;
scanf("%d", n);
for (i = 0;i < n; i++)
result += a;
} - Which of the following is an invalid assignment operator?
-
What is the output of this C code?
int main()
{
unsigned int a = 10;
a = ~a;
printf("%d\n", a);
} -
What is the output of this C code?
int main()
{
if (7 & 8)
printf("Honesty");
if ((~7 & 0x000f) == 8)
printf("is the best policy\n");
} -
Comment on the output of this C code?
int main()
{
int i, n, a = 4;
scanf("%d", &n);
for (i = 0; i < n; i++)
a = a * 2;
} -
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);
}