Ask Question
9 February, 03:43

True or False? In C++, the expression (a + b / c) / 2 is implicitly parenthesized as ((a + b) / c) / 2.

+4
Answers (1)
  1. 9 February, 05:17
    0
    False

    Explanation:

    The two statements are NOT equivalent since the first statement follows the rule of operator precedence in C+ + which assigns highest precendence to values in parenthesis, then division, multiplication, additions and subtraction in that order. In other verify their difference consider this code snippet

    int a = 2;

    int b = 3;

    int c = 5;

    cout ((a + b / c) / 2); / / outputs 1

    cout (((a + b) / c) / 2); / / outputs 0 because a+b is evaluated first
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “True or False? In C++, the expression (a + b / c) / 2 is implicitly parenthesized as ((a + b) / c) / 2. ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers