Programming in C MCQ - Operators and Expressions

Correct AnswerOption D
Rate difficulty Rate difficulty:
Choose a difficulty.
Share this question
Share:
The bitwise AND operator (&), division operator (/), and comma operator (,) all associate from left to right, although they have different precedence levels. Therefore, option D is correct.
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *

Correct AnswerOption D
Rate difficulty Rate difficulty:
Choose a difficulty.

Often the precedence of an operator depends on the context. For example, a minus sign typically has a very high precedence as a unary operator and somewhat lower precedence (lower than multiplication) as a binary operator.
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *

Correct AnswerOption D
Rate difficulty Rate difficulty:
Choose a difficulty.
The increment operator is unary and can appear in prefix (++i) or postfix (i++) form. Both increment a suitable modifiable operand by one, but the value produced by the expression differs between prefix and postfix forms. Therefore, all three statements are correct and option D is the answer.
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *

Correct AnswerOption C
Rate difficulty Rate difficulty:
Choose a difficulty.

5 - 2 -3 *5 -2 will yield 18, if it is treated as (5-(2-3)) * (5-2).
i.e if - has precedence over * and if it associates from the right.
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *

Correct AnswerOption D
Rate difficulty Rate difficulty:
Choose a difficulty.
Found this useful?
Follow:
In C, multiplication, division, and remainder have the same precedence and associate from left to right. Addition and subtraction also associate from left to right. The expression is evaluated according to these precedence and associativity rules, giving the answer shown in option D.
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *

Why Practice with Avatto?
High Quality MCQsExam-focused questions with accurate answers
Detailed ExplanationsStep-by-step explanations to enhance learning
Latest Exam PatternBased on updated syllabus and pattern
Performance AnalyticsTrack performance and improve weak areas
100% Free PracticePractice unlimited questions for free