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 i, j;

    j = 10;

    i = (j++, j + 100, 999 + j);

    cout << i;

    return 0;

    }

  2. A.
    1000
    B.
    11
    C.
    1010
    D.
    1001

    View Answer

    Workspace

    Answer : Option C

    Explanation :

    j starts with the value 10. j is then incremented to 11. Next, j is added to 100. Finally, j (still containing 11) is added to 999 which yields the result 1010.


Be The First To Comment