Home / CSE MCQs / C++ - MCQs :: Discussion

Discussion :: C++ - MCQs

  1. What is the output of this program?
    #include < iostream >
    using namespace std;
    int main ()
    {
    int x, y;
    x = 5;
    y = ++x * ++x;
    cout << x << y;
    x = 5;
    y = x++ * ++x;
    cout << x << y;
    return 0;
    }
  2. A.
    749736
    B.
    736749
    C.
    367497
    D.
    none of the mentioned

    View Answer

    Workspace

    Answer : Option A

    Explanation :

    Because of the precedence the pre-increment and post increment operator, we got the output as 749736.


Be The First To Comment