title: Pointers in C, Abnormal behaviour
body: <p>I'm trying to find the area and perimeter of a circle using pointers. The correct code looks like this </p>
  
  <pre><code>#include&lt;stdio.h&gt;
  
  void main(){
      int radius; 
      float area, peri;
      printf("Enter the radius of a circle: ");
      scanf("%d", &amp;radius);
      areaperi(radius, &amp;area, &amp;peri);
      printf("Area is %f\nPerimeter is %f", area, peri);
  }
  
  areaperi(int r, float *a, float *b){
      *a = 3.14*r*r;
      *b = 2*3.14*r;
  }
  </code></pre>
  
  <p>But if I replace the data type of radius to float while declaring and scanning the radius and change type of <code>r</code> in <code>areaperi()</code> it gives me an error.</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  
  void main(){
      float radius; 
      float area, peri;
      printf("Enter the radius of a circle: ");
      scanf("%f", &amp;radius);
      areaperi(radius, &amp;area, &amp;peri);
      printf("Area is %f\nPerimeter is %f", area, peri);
  }
  
  areaperi(float r, float *a, float *b){
      *a = 3.14*r*r;
      *b = 2*3.14*r;
  }
  </code></pre>
  
  <blockquote>
    <p>[Error]Conflicting types for areaperi</p>
  </blockquote>
  
  <p>I use Dev C++.</p>
  
  <p>I don't understand why my code doesn't work for floating value of radius.</p>