Sail E0 Webinar
Question


What is the output of this program?


1.
#include
2.
using namespace std;
3.
int operate (int a, int b)
4.
{
5.
return (a * b);
6.
}
7.
float operate (float a, float b)
8.
{
9.
return (a / b);
10.
}
11.
int main ()
12.
{
13.
int x = 5, y = 2;
14.
float n = 5.0, m = 2.0;
15.
cout
Options:
A .  119
B .  102.5
C .  123.4
D .  none of the mentioned
Answer: Option B

:In this program, We are overloading the function and getting the output as 10 and 2.5 by division 

and multiplication.
Output:
$ g++ call3.cpp
$ a.out
102.5



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers