0

c++

what would be the value of x if x=5+2*2/2%5? I mean only(5+2*2/2%5) will be compiled a/c to BODMAS but what about modular (%) sign? Which order it will take/

14th Dec 2017, 8:17 AM
SHASHANK SINGH
SHASHANK SINGH - avatar
1 Respuesta
+ 2
Here, x=7 % operator has higher priority than all other operators in this expression. Learn more about operator precedence: http://www.learncpp.com/cpp-tutorial/31-precedence-and-associativity/
14th Dec 2017, 11:53 AM
DAB
DAB - avatar