Loading...

C Multiple Choice Questions

Our C questions and answers focuses on all areas of C programming language covering 100+ topics in C

C Operators and Expression-1 MCQs

C Operators and Expression-1


1. Which of the following operators takes only integer operands?

a) +
b) *
c) /
d) %



2. 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 false
III. Takes place from right to left
IV. Takes place from left to right

a) I and II
b) I and III
c) II and III
d) II and IV



3. Operator % in C Language is called?

a) Percentage Operator
b) Quotient Operator
c) Modulus
d) Division



4. Output of an arithmetic expression with integers and real numbers is ___ by default?

a) Integer
b) Real number
c) Depends on the numbers used in the expression
d) None of the above



5. What is the value of a?
int a = 10 + 4.867;

a) a = 10
b) a = 14.867
c) a = 14
d) compiler error



6. What is the value of a?
int a = 3.5 + 4.5;

a) a = 0
b) a = 7
c) a = 8
d) a = 8.0



7. What is the value of x?
float x = 3.5 + 4.5;

a) x = 8.0
b) x = 8
c) x = 7
d) x = 0.0



8. If both numerator and denominator of a division operation in C language are integers, then we get

a) Expected algebraic real value
b) Unexpected integer value
c) Compiler error
d) None of the above



9. Can you use C Modulo Division operator % with float and int?

a) Only int variables
b) Only float variables
c) int or float combination
d) Numerator int variable, Denominator any variable



10. Associativity of C Operators *, /, %, +, - and = is

a) Operators *, / and % have Left to Right Associativity. Operators + and - have Left to Right Associativity. Operator = has Right to Left Associativity.
B) Operators *, / and % have Right to Left Associativity. Operators + and - have Left to Right Associativity. Operator = has Right to Left Associativity.
C) Operators *, / and % have Right to Left Associativity. Operators + and - have Right to Left Associativity. Operator = has Right to Left Associativity.
D) Operators *, / and % have Right to Left Associativity. Operators + and - have Right to Left Associativity. Operator = has Left to Right Associativity.



- Related Topics