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

Discussion :: C++ - MCQs

  1. What is the output of this program?

    #include < stdio.h >

    using namespace std;

    int main()

    {

    int array[] = {10, 20, 30};

    cout << -2[array];

    return 0;

    }


  2. A.
    -15
    B.
    -30
    C.
    compile time error
    D.
    garbage value

    View Answer

    Workspace

    Answer : Option B

    Explanation :

    It's just printing the negative value of the concern element.


Be The First To Comment