title: Quadratic equation roots function
body: <p><strong>The problem</strong></p>
  
  <p>Write a function that calculates the real and imaginary roots of the quadratic equation</p>
  
  <pre><code>ax^2 +bx+c = 0
  </code></pre>
  
  <p>You should handle the three types of roots.</p>
  
  <p>Hint: use this function prototype:</p>
  
  <pre><code>int calculateRoots(int a,int b,int c,float* root1,float* root2);
  </code></pre>
  
  <p>My questions:</p>
  
  <ul>
  <li>how can a function solving quadratic equation returns an int? I am clueless on what that means</li>
  <li>I changed the fuction return type to <code>void()</code> but I couldn't handle the 2 imaginary roots not sure how to return real+imag i</li>
  </ul>
  
  <p>Here 's what I reached so far:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;math.h&gt;
  
  
  void calculateRoots(int a,int b,int c,float* root1,float* root2);
      int main()
      {
          float r1,r2;
          int a,b,c;
          printf("enter the coefficients :\n");
          scanf("%d%d%d",&amp;a,&amp;b,&amp;c);
             void calculateRoots(a,b,c,&amp;r1,&amp;r2);
          printf("%d and %d are roots,r1,r2);
          return 0;
      }
      void calculateRoots(int a,int b,int c,float* root1,float* root2)
      {   float x=b*b-4*a*c;
          if(x==0)
          {
              *root1=(-1*b)/(2*a);
              *root2=(-1*b)/(2*a);
          }
          else if(x&gt;0)
          {
              *root1=(-1*b+x)/(2*a) ;
              *root2=(-1*b-x)/(2*a) ;
          }
          if(x&lt;0)
          {
              root1=// Any help here
          }
      }
  </code></pre>