hamburger menu
All Coursesall course arrow
adda247
reward-icon
adda247
    arrow
    arrow
    arrow
    What will be the output of the following C++ code snippet?#include <iostream>using namespace std;int main() { int a = 25, b = 14; cout &lt
    Question

    What will be the output of the following C++ code snippet?

    #include <iostream>
    using namespace std;

    int main() {
    int a = 25, b = 14;
    cout << a << " + " << b << " = " << a + b;
    return 0;
    }

    A.

    14+12=25

    B.

    14-0=14

    C.

    25+14=39

    D.

    Compilation Error

    E.

    Syntax Error

    Correct option is C

    The code will output 25+14=39. This is because the variables a and b are initialized with the values 25 and 14, respectively, and the cout statement concatenates the values of a and b along with the string "+" and "=". The expression a + b evaluates to 39 and is displayed as part of the output.

    Free Tests

    Free
    Must Attempt

    RBI Asst Prelims 2026: Quant Advance level Test 01

    languageIcon English
    • pdpQsnIcon35 Questions
    • pdpsheetsIcon35 Marks
    • timerIcon20 Mins
    languageIcon English
    Free
    Must Attempt

    RBI Asst Prelims 2026: Reasoning Advance level Test 01

    languageIcon English
    • pdpQsnIcon35 Questions
    • pdpsheetsIcon35 Marks
    • timerIcon20 Mins
    languageIcon English
    Free
    Must Attempt

    NABARD Development Assistant Mains 2026 Full Mock Test -01

    languageIcon English
    • pdpQsnIcon150 Questions
    • pdpsheetsIcon150 Marks
    • timerIcon105 Mins
    languageIcon English
    test-prime-package

    Access ‘IBPS SO IT Officer’ Mock Tests with

    • 60000+ Mocks and Previous Year Papers
    • Unlimited Re-Attempts
    • Personalised Report Card
    • 500% Refund on Final Selection
    • Largest Community
    students-icon
    383k+ students have already unlocked exclusive benefits with Test Prime!
    Our Plans
    Monthsup-arrow