Operators In C Multiple Choice Questions. These MCQs contain different topics on C operators such as Relational Operators, Arithmetic operators, Ternary Operators, Unary Operators, Assignment Operators, Bitwise Operators, etc.
What is the output of the C statement ??
int main()
{
int a=0;
a = 4 + 4/2*5 + 20;
printf(“%d”, a);
return 0;
}
A) 40
B) 4
C) 34
D) 54
When applied to a variable what does the unary “&” operator yield ??
A. The variable’s address
B. The variables right value
C. The variable’s binary form
D. The variable’s value
What is the Priority among these C Operators ??
(*, /, %), (+, -) and (=)
A) (*, /, %) > (+, -) < (=)
B) (*, /, %) < (+, -) < (=)
C) (*, /, %) > (+, -) > (=)
D) (*, /, %) < (+, -) (+, -) == (=)
Which operators perform operations on data at binary level ??
A. Logical operator
B. Bitwise operator
C. Additional operators
D. None of the above
What is the correct output of this C code ??
void main()
{
char a = ‘a’;
int x = (a % 10)++;
printf(“%d\n”, x);
}
A. 6
B. Junk value
C. Compile-time error
D. 7
An operator used to check a condition and select a value depending on the value of the condition is called ??
A. Logical operator
B. Decrement operator
C. Conditional or Ternary operator
D. Bitwise operator
What will be the output of the following code ??
void main()
{
int k = 8;
int x = 0 == 1 && k++;
printf(“%d%d\n”, x, k);
}
A. 0 9
B. 0 8
C. 1 9
D. 1 8
While assigning a value to a variable which operators are used to performing arithmetic operations ??
A. Logical operator
B. Assignment operator
C. Increment operator
D. Conditional operator
What is the correct output ??
void main()
{
int x = 0;
if (x = 0)
printf(“Its zero\n”);
else
printf(“Its not zero\n”);
}
A. It’s not zero
B. Its zero
C. Run time error
D. None
- 1
- 2
- 3
- 4
- …
- 6
- Go to the next page