Printing the absolute value without using cmath
<p>I am a beginner in C++ and I need help printing the absolute difference of 2 integers. How can I go about doing that without using cmath? </p>

<p>This is what I have so far :</p>

<pre><code>    #include&lt;iostream&gt;
    #include&lt;cstdlib&gt;
    using namespace std;

    abs(double num1, double num2);

    int main()
    {

             double n1, n2, num1, num2, results;

         cout&lt;&lt;" Enter two numbers : ";
         cin&gt;&gt;n1 &gt;&gt; n2 ;
         results= abs(num1, num2);
         cout&lt;&lt;" Absoulte value of your two numbers is " &lt;&lt; results &lt;&lt;endl;

        return 0;
    }

    abs(double num1, double num2)
    {
       return abs(num1, num2);
    }
</code></pre>
