title: Program in c++ tell if a number is integer or float
body: <p>I used function overload to check if an input number is integer or float. However I get this following error:
  error: call of overloaded 'retNr(double)' is ambiguous|</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  void retNr(int x)
  {
      cout &lt;&lt; "The entered number is an integer. " &lt;&lt; endl;
  }
  
  void retNr(float x)
  {
      cout &lt;&lt; "The entered number is a float. " &lt;&lt; endl;
  }
  
  int main()
  {
      cout &lt;&lt; "Please enter a number: " &lt;&lt; endl;
      cin &gt;&gt; nr;
      retNr(nr);
      return 0;
  }
  </code></pre>