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 a = 5, b = 6, c;

    c = (a > b) ? a : b;

    cout << c;

    return 0;

    }

  2. A.
    6
    B.
    5
    C.
    4
    D.
    7

    View Answer

    Workspace

    Answer : Option A

    Explanation :

    Here the condition is false on conditional operator, so the b value is assigned to c


Be The First To Comment