retagged by
2,549 views
3 votes
3 votes

Which of the following is the correct order of evaluation for the below expression? 

$z=x+y^*z/4\%2-1$

  1. $^*/\%+-=$
  2. $=^*/\%+-$
  3. $/^*\%-+=$
  4. $^*\% /-+=$
retagged by

2 Answers

3 votes
3 votes

precedence order of *,/,% are same and associativity is left to right so */% and similarly for +,- order are same and associativity is left to right and at last = has least precedence among them so it will be evaluated at last.

So (A) should be correct option.

Answer:

Related questions

3 votes
3 votes
1 answer
1
admin asked Mar 31, 2020
887 views
What data structures is used for depth first traversal of a graph?QueueStackListNone of the above
3 votes
3 votes
2 answers
2
admin asked Mar 31, 2020
3,110 views
In the ________ traversal we process all of a vertex's descendants before we move to an adjacent vertex.Depth FirstBreadth FirstWidth FirstDepth Limited
4 votes
4 votes
1 answer
3
admin asked Mar 31, 2020
1,850 views
The number of unused pointers in a complete binary tree of depth $5$ is:$4$$8$$16$$32$
4 votes
4 votes
4 answers
4
admin asked Mar 31, 2020
2,007 views
A ________ is a linear list in which insertions and deletions are made to from either end of the structure.Circular queue.Priority queue.Stack.Dequeue.