Sail E0 Webinar
Question


What is the output of the following 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 .  10.0 5.0
B .  5.0 2.5
C .  10.0 5
D .  10 2.5
Answer: Option D

In this program, we are divide and multiply the values.
Output:
$ g++ over3.cpp
$ a.out
10 2.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