Ask Question
25 November, 01:31

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

+2
Answers (1)
  1. 25 November, 04:46
    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?
Find 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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers