Question #231914

what is the program output/errors

#include<iostream>

  using namespace std;

   int fun (int x, int y) 

   {

return x + y;

   }

double fun (int x, int y)

{ 

return x * y; 

}

int main() 

{

cout<<fun(5, 10); 

return 0; 

 

}


Expert's answer

The program error is an ambiguating the new declaration of 'double fun(int, int)'.

Where the old declaration 'int fun(int, int)'.


LATEST TUTORIALS
APPROVED BY CLIENTS