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
Video Solutions

RBI Assistant Pre 2026 Full Mock Test -01

languageIcon English
  • pdpQsnIcon100 Questions
  • pdpsheetsIcon100 Marks
  • timerIcon60 Mins
languageIcon English
Free
Must Attempt
Video Solutions

RBI Asst Prelims 2026 : Reasoning Section Test 01

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

RBI Office Attendant 2026 Full Mock Test - 01

languageIcon English
  • pdpQsnIcon120 Questions
  • pdpsheetsIcon120 Marks
  • timerIcon90 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
353k+ students have already unlocked exclusive benefits with Test Prime!
Our Plans
Monthsup-arrow