Below is the code, when I am executing. No output in the console. Not sure why.
I am testing one example of function overloading in C++.
Function Overloading. Created 2 functions of the same name with different arguments. When tried to pass integer value in main during the function call. It worked fine. But when passed as float number, neither error nor output is coming.
#include <iostream>
using namespace std;
int max(int x,int y)
{
cout<<"Entered in max int"<<endl;
if(x>=y)
return x;
else
return y;
}
float max(float x,float y)
{
cout<<"Entered in max float"<<endl;
if(x>=y)
return x;
else
return y;
}
int main()
{
float x;
x=max(5.9,6.7);
}