Vidyalelo
C Programming · all questions

Operators and Expressions
practice.

Practice every MCQ with options. Use Show answers when you want the correct option and solution.

85

Questions

2/5

Page

Pick an option on a question to see the right answer and solution.

What is the result of the expression (10 + 2) / 2 in C?

Select an option to see the answer and solution.

Which operator is used for inequality comparison in C?

Select an option to see the answer and solution.

What is the result of the expression 2.5 + 2 in C?

Select an option to see the answer and solution.

What is the result of the expression 8 % 4 in C?

Select an option to see the answer and solution.

Which operator is used to perform a bitwise OR operation in C?

Select an option to see the answer and solution.

What is the result of the expression 1 && 0 in C?

Select an option to see the answer and solution.

What is the result of the expression 5 * (1 + 2) - 3 in C?

Select an option to see the answer and solution.

Which operator is used to perform a bitwise XOR operation in C?

Select an option to see the answer and solution.

What is the result of the expression (6 + 3) / 0 in C?

Select an option to see the answer and solution.

What is the result of the expression 5 / 2.0 in C?

Select an option to see the answer and solution.

Which of the following operator takes only integer operands?

Select an option to see the answer and solution.

In an expression involving || operator, evaluation
I.   Will be stopped if one of its components evaluates to false
II.  Will be stopped if one of its components evaluates to true
III. Takes place from right to left
IV.  Takes place from left to right

Select an option to see the answer and solution.

Determine output:
void main()
{
      int i=0, j=1, k=2, m;
      m = i++ || j++ || k++;
      printf("%d %d %d %d", m, i, j, k);
}

Select an option to see the answer and solution.

Determine output:
void main()
{
      int c = - -2; 
      printf("c=%d", c); 
}

Select an option to see the answer and solution.

Determine output:
void main()
{ 
      int i=10; 
      i = !i>14; 
      printf("i=%d", i); 
}

Select an option to see the answer and solution.

In C programming language, which of the following type of operators have the highest precedence

Select an option to see the answer and solution.

What will be the output of the following program?
void main()
{
      int a, b, c, d;
      a = 3;
      b = 5;
      c = a, b;
      d = (a, b);
      printf("c=%d d=%d", c, d);
}

Select an option to see the answer and solution.

Which of the following comments about the ++ operator are correct?

Select an option to see the answer and solution.

What will be the output of this program on an implementation where "int" occupies 2 bytes?
#include <stdio.h>
void main()
{
      int i = 3;
      int j;
      j = sizeof(++i + ++i);
      printf("i=%d j=%d", i, j);
}

Select an option to see the answer and solution.

Which operator has the lowest priority?

Select an option to see the answer and solution.