A

Admin • 833K Points
Coach

Q. What is the output of the following C++ code?

Code:
#include <iostream>
using namespace std;
int sum(int a, int b, int c)
{
return a + b;
}
double sum(double a, double b, double c)
{
return a + b;
}
int main()
{
cout << sum(1, 2);
cout << sum(1.5, 2.5);
return 0;
}
  • (A) Compilation error
  • (B) 3 4.5
  • (C) 4 3
  • (D) 3 4
  • Correct Answer - Option(A)
  • Views: 24
  • Filed under category C++
  • Hashtags:

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.